White VUE learning how to read the first article --- Internet search to articles --- code or VUE three modes of VUE:

White VUE learning how to read the first article --- Internet search to articles --- code or VUE three modes of VUE:

  1. Direct reference VUE;
  2. Once downloaded to a local vue.js using the catalog;
  3. Node installation environments;
  4. ant-design-vue just a set of ant-design UI template code Vue realize, the real use of or VUE environment;

 

  • VUE direct reference (copy code directly saved as a html file to double-click in a browser): <script src = "https://unpkg.com/vue"> </ script> 

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<script src="https://unpkg.com/vue"></script>
</head>

<body>
<div id="container">
<myc:level="1">直接引用VUE!</myc>
</div>

<script type="text/javascript">

Vue.component('myc', {
render: function(createElement) {
return createElement(
'h' + this.level,
this.$slots.default
)
},
props: {
level: {
type: Number,
required: true
}
}
})

// declare Vue not on the top, only on the following
new new Vue ({
EL: '#container'
});
</ Script>

</body>

</html>

  • After vue.js downloaded to the local use from this category:

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>

<script src="vue.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
<div ID = "Container">
<myc: Level = ". 1"> will vue.js downloaded to the local catalog using </ myc>!
</ div>

<script type="text/javascript">

Vue.component('myc', {
render: function(createElement) {
return createElement(
'h' + this.level,
this.$slots.default
)
},
props: {
level: {
type: Number,
required: true
}
}
})

// declare Vue not on the top, only on the following
new new Vue ({
EL: '#container'
});
</ Script>

</body>

</html>

 

  • Node installation environments:

<Template>
<div>
<myc: Level = ". 5">! mounted Node environments </ myc>
</ div>
</ Template>

<script>
export default {
data() {
return {

}
},
methods: {

},
components: {
myc: {
render: function (createElement) {
return createElement(
'h' + this.level,
this.$slots.default
)
},
props: {
level: {
type: Number,
required: true
}
}
}
}
}
</script>

 

Guess you like

Origin www.cnblogs.com/li9club/p/11522153.html