Closed liyasthomas closed 3 years ago
Litepie Datepicker only support Vue 3 so, Nuxt v2.* still use Vue 2 you can using alternatif of Litepie Datepicker for Vue 2 https://www.npmjs.com/package/vue2-litepie-datepicker
Awesome. Never knew this existed. Awesome project - looking forward to playing with it.
I think, It would be better if you add information about Vue3 and vue2 product link in this project description or in the README.md file. Thank you for great project
<div class="w-full max-w-md">
<litepie-datepicker as-single v-model="storePublishDate"></litepie-datepicker>
</div>
what is problem ?
@kenhyuwa I tried all this by installing the vue2 version but it still doesn't work due to the ref used from the composition API, would please give us a basic example of Datepicker that works with Nuxt v2.x and Vue 2 ? I checked all the issues and there is no example for that especially because the examples in the Vue npm package is are the same as the Vue 3 DatePicker
@kenhyuwa I tried all this by installing the vue2 version but it still doesn't work due to the ref used from the composition API, would please give us a basic example of Datepicker that works with Nuxt v2.x and Vue 2 ? I checked all the issues and there is no example for that especially because the examples in the Vue npm package is are the same as the Vue 3 DatePicker
tried with API
@kenhyuwa I tried to change the ref of the composition-api with the reqRef of the @nuxt/composition API but it's deprecated, if you have a concrete working example please let me know
Hello @kenhyuwa trying the project you suggested along with nuxtjs/composition-api
with the following tailwind.config.js
const path = require('path');
const colors = require('tailwindcss/colors');
module.exports = {
mode: 'jit',
purge: {
content: [
path.resolve(__dirname, './node_modules/vue2-litepie-datepicker/**/*.js'),
'components/**/*.vue',
'layouts/**/*.vue',
'pages/**/*.vue',
'plugins/**/*.js',
'nuxt.config.js',
// TypeScript
'plugins/**/*.ts',
'nuxt.config.ts',
'formulate.config.js',
],
safelist: ['focus:ring-green-500', 'focus:ring', 'outline-none'],
},
important: true,
// https://color-mode.nuxtjs.org/#tailwind-v2
darkMode: 'class', // false or 'media' or 'class'
theme: {
borderWidth: {
DEFAULT: '1px',
0: '0',
2: '2px',
3: '3px',
4: '4px',
8: '8px',
},
extend: {
colors: {
orange: colors.orange,
primary: '#8D57A3',
secondary: '#DD4799',
trinary: '#50C0AB',
accent: '#49B3E6',
error: '#ff7285',
textPrimary: '#212125',
textSecondary: '#909399',
'litepie-primary': colors.lightBlue, // color system for light mode
'litepie-secondary': colors.coolGray, // color system for dark mode
},
},
},
variants: {
extend: {
cursor: ['disabled'],
textOpacity: ['disabled'],
textColor: ['disabled'],
},
},
plugins: [
require('@tailwindcss/typography'),
// require('@tailwindcss/forms')
],
};
Notice the purge is slightly different as I am targetting the vue2 package
With all that said the styling is completely broken and all i see in the screen is this
Also the Vue2 package by @vinayakkulkarni doesn't have a proper documentation as it seems that it's a copy past of this project. I would appreciate it if I can get some guidelines from you guys
@kenhyuwa @vinayakkulkarni and if @liyasthomas got it to work
solutions dont use jit
mode,
use ssrRef
instead reqRef
, please check documentation of @nuxtjs/composition-api.
for now, this some trick for this issues.
maybe I'll fix for Litepie Datepicker.
@kenhyuwa thanks for your response, I tried to do the exact same thing, disabling the jit mode and replacing reqRef with ssrRef, and nothing change in my case, taking into consideration that the majority of the style works for me except one thing which the initial hide of the years and months block initially like this image shows
the problem is that there is a flex display applied that made thedisplay:none
applied for each block based on the user click not valid
display: none
not applied
if there is any thoughts about this please let me know because I think that this is the problem and that this is not related to jit
@kenhyuwa any updates, sir?
Why was this closed? Seems like the issue is still there..
Hello @kenhyuwa trying the project you suggested along with
nuxtjs/composition-api
with the followingtailwind.config.js
const path = require('path'); const colors = require('tailwindcss/colors'); module.exports = { mode: 'jit', purge: { content: [ path.resolve(__dirname, './node_modules/vue2-litepie-datepicker/**/*.js'), 'components/**/*.vue', 'layouts/**/*.vue', 'pages/**/*.vue', 'plugins/**/*.js', 'nuxt.config.js', // TypeScript 'plugins/**/*.ts', 'nuxt.config.ts', 'formulate.config.js', ], safelist: ['focus:ring-green-500', 'focus:ring', 'outline-none'], }, important: true, // https://color-mode.nuxtjs.org/#tailwind-v2 darkMode: 'class', // false or 'media' or 'class' theme: { borderWidth: { DEFAULT: '1px', 0: '0', 2: '2px', 3: '3px', 4: '4px', 8: '8px', }, extend: { colors: { orange: colors.orange, primary: '#8D57A3', secondary: '#DD4799', trinary: '#50C0AB', accent: '#49B3E6', error: '#ff7285', textPrimary: '#212125', textSecondary: '#909399', 'litepie-primary': colors.lightBlue, // color system for light mode 'litepie-secondary': colors.coolGray, // color system for dark mode }, }, }, variants: { extend: { cursor: ['disabled'], textOpacity: ['disabled'], textColor: ['disabled'], }, }, plugins: [ require('@tailwindcss/typography'), // require('@tailwindcss/forms') ], };
Notice the purge is slightly different as I am targetting the vue2 package
With all that said the styling is completely broken and all i see in the screen is this
Also the Vue2 package by @vinayakkulkarni doesn't have a proper documentation as it seems that it's a copy past of this project. I would appreciate it if I can get some guidelines from you guys
@kenhyuwa @vinayakkulkarni and if @liyasthomas got it to work
I plan to update the docs for Vue 2 version!
I tried to install
litepie-datepicker
in my Nuxt 2.x project which has Vue v2.x under the hood and having some issues. Even though I was able to addlitepie-datepicker
as a plugin - it's throwing errors such as:This is my Nuxt.js plugin file: