Files
ClassContent/历届学生/fontendsix/每日课程/2021-11-23/index.html
2024-09-27 02:06:13 +08:00

67 lines
1.4 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 class="app" v-title=" '首页' ">
{{ hello | sub }}
<h2></h2>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<script>
var mix = {
data() {
return {
page: 1,
totalPage: 0
}
},
methods: {
testTwo() {
return "testTwo"
}
}
}
new Vue({
el: '.app',
mixins: [mix],
data: {
hello: '这是测试的问题哈很多很多很多很多很多很多很多很多和',
demo: '你好'
},
created() {
console.log(this.page);
console.log(this.testTwo());
},
methods: {
test() {
}
},
filters: {
sub(str) {
return str.substring(0, 10) + '...'
}
},
directives: {
title: {
bind: function (el, binding) {
var html = `<div class="header">${binding.value}</div>`
el.innerHTML = html + el.innerHTML
}
}
}
})
</script>
</html>