Sun Jun 11 03:32:00 UTC 2023 inscode

上级 f7de69cf
......@@ -36,6 +36,7 @@ import Left from './components/Left.vue'
import Article from './components/Article.vue';
export default {
components: {
Left,
......
<template>
<div class="article-container">
<h3>Article 组件</h3>
<h3 v-color>Article 组件</h3>
<!-- 文章的标题 -->
<div class="header-box">
<slot name="title"></slot>
......@@ -21,6 +21,15 @@
<script>
export default {
directives:{
color:{
bind(el){
console.log('触发了自定义指令 v-color 的 color 函数');
el.style.color='red';
}
}
},
// 首字母要大写
name: 'Article',
data(){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册