K
K
Konstantin Marchenko2019-01-09 18:46:44
Vue.js
Konstantin Marchenko, 2019-01-09 18:46:44

Connecting VUE components in HTML?

Hello! Please tell me - how to connect vue components in a regular html file? For example:
https://vuejsexamples.com/lightweight-and-mobile-f...
This is a calendar. But the connection goes like this:

<template>
    <date-pick v-model="date"></date-pick>
</template>

<script>
import DatePick from 'vue-date-pick';
import 'vue-date-pick/dist/vueDatePick.css';

export default {
    components: {DatePick},
    data: () => ({
        date: '2019-01-01'
    })
};
</script>

But I don't understand how I can set it all up just in a regular html file.... I'm not very familiar with Vue yet.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-01-09
@rifer

in normal html file

You mean without using build systems?
Well, include the code and styles:
<script src="vue-date-pick-master/dist/vueDatePick.js"></script>
<link href="vue-date-pick-master/dist/vueDatePick.css" rel="stylesheet">

Everything, the component will be available through the VueDatePick variable.
Then you can specify it in components:
components: {
  VueDatePick,
},

Or register globally:
Vue.component('date-pick', VueDatePick);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question