olton / Metro-UI-CSS

Impressive component library for expressive web development! Build responsive projects on the web with the first front-end component library in Metro Style. And now there are even more opportunities every day!
http://metroui.org.ua/
MIT License
7k stars 1.97k forks source link

Metro UI using Vue js #1037

Closed DarkKangaroot closed 6 years ago

DarkKangaroot commented 6 years ago

Hello sir Can i use this framework in Vue js? the datepicker and calendar seem not working in vue js but other input is working..

 <label>Calendar Picker</label>    
                    <input type="text" data-role="calendarpicker" v-model="calendar">
  <label>Date Picker</label>    
                    <input data-role="datepicker" v-model="date"> 
olton commented 6 years ago

Hi 1) What does it mean does not work? 2) To change the picker value, change the attribute value

Please read https://github.com/olton/Metro-UI-CSS/blob/master/CONTRIBUTING.md#issues-guidelines

DarkKangaroot commented 6 years ago

Hi sir this is my html and its id.

<label>Calendar Picker</label>    
                    <input type="text" data-role="calendarpicker" id="calendar">
                    <label>Date Picker</label>    
                    <input data-role="datepicker" type="text" id="date"> 

<button class="button primary drop-shadow" @click="btnDate()">Date/Calendar</button>

i was using this javascript a while ago

var date = document.getElementById("date");
var calendar = document.getElementById("calendar");

 new Vue({
            el: '#app',
            data: {
                datepick: '',
                calendarpick: '' ,
                input: ''
            },
            methods: {
                btnDate: function() {
                   console.log(date .value);
                   console.log(calendar .value)

                }
            }
        })

then i change my variable to this.

var datepick = $('date').data('datepicker')
var calendarpick = $('calendar').data('calendarpicker')

and my vue button

console.log(datepick.val());
console.log(calendarpick.val())

Thank you sir for your Time :)

olton commented 6 years ago

When working with Vue there are problems, now I'm trying to contact the developer Vue, to solve the existing problems.

olton commented 6 years ago

To work with VueJS You must do the following: 1) add meta tag of late initialization Metro 4 <meta name="metro4:init" content="false"> 2) Initialize Metro 4 in the Hooked Mounted

    var app = new Vue({
        el: '#app',
        data: {
        },
        mounted: function () {
            Metro.init();
        }
    })

https://codepen.io/olton/pen/zWomRo

DarkKangaroot commented 6 years ago

Thank you sir its working now sir .. may i mind my last quest sir why i am seeing this sir? i just dont know how to remove this sir

untitled the data field is duplacating also in datepicker sir Thank you sir

olton commented 6 years ago

read above

DarkKangaroot commented 6 years ago

and sir also in select the select is always closing and in console i had this error

Uncaught TypeError: Cannot read property 'close' of undefined

thank you sir

olton commented 6 years ago

create pen on codepen.io

DarkKangaroot commented 6 years ago

in codepen sir there no error.. :( the select is working and also the other input

https://codepen.io/LeoKi12/pen/dmOLbb

olton commented 6 years ago

Make sure you are using the latest version of Metro 4. To check it, execute in the browser console: Metro.about() You must see Metro 4 Components Library - v4.1.0-625

DarkKangaroot commented 6 years ago

yes sir i am using the latest version of Matro Ui.

Metro 4 Components Library - v4.1.0-625

olton commented 6 years ago

Give me the link to the page or create an original page on codepen.io. Without original code, I don't help you.

DarkKangaroot commented 6 years ago

here i am getting the sample https://metroui.org.ua/forms.html

here my code pen but its working https://codepen.io/LeoKi12/pen/dmOLbb

here's my file that not working. and has many duplicate

4. Form.zip

Thank you sir :)

olton commented 6 years ago

In your code:

var app = new Vue({
            el: '#app',
            data: {
                datepick: '',
                calendarpick: '' ,
                input: ''
            },
            created: function(){
                Metro.init();
                Metro.about();
            },  
            methods: {
                btnDate: function() {

                    alert(date.value);
                    alert(calendar.value);

                }
            }
        })

Change created hook to mounted

DarkKangaroot commented 6 years ago

ahh. i already did sir but still the view of input duplication. i had some error in console of browser

Uncaught TypeError: Cannot read property 'close' of undefined

thank you for your help sir :)

olton commented 6 years ago

I do not have errors in the console

2018-03-19_16h33_14

DarkKangaroot commented 6 years ago

hmm.. it's weird sir hehe.. im using chrom then i try i on edge and firefox and now it working but in chrome .. still duplication..

DarkKangaroot commented 6 years ago

i think need to update my chrom hehe ..

Thank you so much sir.. i am so much like of metro ui because it's flat desing .. Thank you sir ..

DarkKangaroot commented 6 years ago

oh.. thank you sir.. it's working now.. hehhe