Files
ClassContent/历届学生/front-end-team-10/每天课程/2023-03-21/混入.html
2024-09-27 02:06:13 +08:00

61 lines
1.2 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>混入</title>
</head>
<body>
<div class="app">
<input type="text" autofocus="true" placeholder="输入账户名">
<button @click="load">加载更多</button>
<p>{{text | slh}}</p>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.7.14/dist/vue.js"></script>
<script>
var loadMore = {
data() {
return {
page: 0,
totalPage: 0
}
},
methods: {
load() {
console.log("加载更多...");
}
}
}
Vue.directive('focus', {
inserted: function (el) {
el.focus()
}
})
new Vue({
el: '.app',
mixins: [loadMore],
data: {
text: '你好这是测试的文字,哈哈哈'
},
created() {
console.log(this.page);
},
methods: {
},
filters: {
slh(val) {
return val.substring(0,4) + '...'
}
}
})
</script>
</html>