Put the laydate downloaded package into the static
index.html Introduction
Where the yellow part is the part of the code that is added
<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <Metaname= "Viewport"content= "width=device-width,initial-scale=1.0"> <title>Vue_test</title> <script src= "Src/assets/laydate/laydate.js"></ Script> </Head> <Body> <DivID= "App"></Div> <!--built files would be auto injected - </Body></HTML>
Using in Components
such as Helloworld.vue
<Template> <Divclass= "Hello"> <input type= "text" ID= "Test" v-model = "Date"> <!-- - </Div></Template><Script>Exportdefault{name:'HelloWorld', data () {return{msg:'Welcome to Your vue.js App', Date:'2017-09-08 09:00:00'}}, mounted: function () {console.log (laydate) laydate.render ({elem: '#test c7> ', type:'datetime', Done: (value) => { this. Date = Value}}) }}</Script><!--Add "scoped" attribute to limit CSS to this component only -<stylescoped>H1, H2{Font-weight:Normal;}ul{List-style-type:None;padding:0;}Li{Display:Inline-block;margin:0 10px;}a{Color:#42b983;}</style>
Show effect
Source: HTTPS://PAN.BAIDU.COM/S/1NV3PDJZ
How to refer to the Laydate.js date plugin in Vue learning Vue