51 lines
1.1 KiB
HTML
51 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<title>Document</title>
|
||
</head>
|
||
<body>
|
||
<div id="app">
|
||
<apps :new_-lists="list">
|
||
<!--
|
||
v-bind标签是不支持驼峰标识,因此在v-bind中如果要是使用驼峰标识就必须使用-进行连接转译
|
||
-->
|
||
</apps>
|
||
</div>
|
||
</body>
|
||
<template id="tpl">
|
||
<div>
|
||
<h1>{{new_Lists}}</h1>
|
||
</div>
|
||
</template>
|
||
<script src="../../../00-tools/JavaScript/vue.js"></script>
|
||
<script>
|
||
const vue=new Vue({
|
||
el:"#app",
|
||
data:{
|
||
list:['列表项1', '列表项2', '列表项3', '列表项4', '列表项5', '列表项6']
|
||
},
|
||
components:{
|
||
'apps':{
|
||
template:"#tpl",
|
||
// 1、props:['new_lists']
|
||
props:{
|
||
new_Lists:{
|
||
type:Array,
|
||
default(){
|
||
return ['None']
|
||
},
|
||
}
|
||
}
|
||
// 3、props:{
|
||
// new_lists(val){
|
||
// return ['列表项1'].indexOf(val)!=-1
|
||
// }
|
||
// }
|
||
}
|
||
}
|
||
})
|
||
</script>
|
||
</html> |