vue.extend 扩展实例构造器一般与组件联合使用

代码示例如下:

<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>vue.extend 扩展实例构造器</title>
<script src="../assets/js/vue.js"></script>
</head>

<body>
<h1>vue.extend 扩展实例构造器</h1>
<hr>
<div ></div>

<script>
var authorURL = Vue.extend({
template: '<p><a :href="authorURL">{{authorName}}</a></p>',
data () {
return {
authorName: 'http://wwww.baidu.com',
authorURL: 'http://wwww.baidu.com'
}
}
})

new authorURL().$mount("#author")

</script>
</body>

</html>
vue.js基础__vue.extend 扩展实例构造器

 

相关文章:

  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-09-03
  • 2021-06-12
  • 2022-12-23
  • 2021-09-17
  • 2021-09-22
猜你喜欢
  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案