随笔分类 - codewhy模块
摘要:父组件 : <template> <div> 父组件 : {{data.name}} - {{data.age}} - {{data.hight}} <hr> <Hello :data="data"></Hello> </div> </template> <script> import Hello
阅读全文
摘要:<template> <div> <h1>浅层解包</h1> {{ageobj.age.value}} {{ageobj.age}} <button @click="ageobj.age.value++ ">修改浅层解包的年龄</button> </div> </template> <script>
阅读全文
摘要:<template> <div> <h1>vue3</h1> <span>{{name}} - {{age}}</span> <button @click="refname">函数修改name</button> <button @click="name = '刚'">直接修改name</button
阅读全文
摘要:<template> <div> <h1>vue3</h1> <span>{{info.name}} - {{info.age}}</span> <button @click="infobtn">修改info</button> </div> </template> <script> import {
阅读全文
摘要:父组件 : <template> <div class="app"> <!-- 1.组件的v-model: 默认modelValue --> <counter v-model="appCounter"></counter> <!-- 上面的相当于下面的 --> <counter :modelValu
阅读全文
摘要:父组件 : <template> <div class="app"> <div class="view"> <!-- include: 组件的名称来自于组件定义时name选项 --> <keep-alive include="home,about"> <component :is="currentT
阅读全文
摘要:父组件 : <template> <div class="app"> <!-- 动态组件 component --> <!-- is中的组件需要来自两个地方: 1.全局注册的组件 2.局部注册的组件 --> <!-- <component :is="tabs[currentIndex]"></com
阅读全文
摘要:<template> <div class="app"> <h2 ref="title" class="title" :style="{ color: titleColor }">{{ message }}</h2> <button ref="btn" @click="changeTitle">修改
阅读全文
摘要:1.引入库 在 src/until/event-bus.js import { HYEventBus } from 'hy-event-store' const eventBus = new HYEventBus() export default eventBus 2. 使用 1.发送 <templ
阅读全文
摘要:祖先 : <template> <div class="app"> <home></home> <h2>App: {{ message }}</h2> <button @click="message = 'hello world'">修改message</button> </div> </templ
阅读全文
摘要:父组件 : <template> <div class="app"> <tab-control :titles="['衣服', '鞋子', '裤子']" @tab-item-click="tabItemClick"> <template v-slot="props"> <button>{{ prop
阅读全文
摘要:父组件 : <template> <!-- nav-bar只给一个插槽动态传入数据 --> <nav-bar> <template v-slot:[position]> <a href="#">注册</a> </template> </nav-bar> <button @click=" positi
阅读全文
摘要:父组件 : <template> <nav-bar> <template #left> <button>{{ leftText }}</button> </template> <template #center> <span>内容</span> </template> <template v-slo
阅读全文
摘要:父组件 : <template> <div class="app"> <!-- 1.内容是button --> <show-message title="哈哈哈"> <button>我是按钮元素</button> </show-message> <!-- 2.内容是超链接 --> <show-mes
阅读全文
摘要:父组件 : <template> <div class="app"> <h2>当前计数: {{ counter }}</h2> <!-- 1.自定义add-counter, 并且监听内部的add事件 --> <add-counter @add="addBtnClick"></add-counter>
阅读全文
摘要:父组件 : <template> <div class="app"> <h2>当前计数: {{ counter }}</h2> <!-- 并且监听内部的sub事件 --> <sub-counter @sub="subBtnClick"></sub-counter> </div> </template
阅读全文
摘要:父组件 : <template> <!-- 如果当前的属性是一个非prop的attribute, 那么该属性会默认添加到子组件的根元素上 --> <show-info name="why" :age="18" :height="1.88" address="广州市" abc="cba" class=
阅读全文
摘要:父组件 : <template> <!-- 1.展示why的个人信息 --> <show-info name="why" :age="18" :height="1.88" /> </template> <script> import ShowInfo from './ShowInfo.vue' ex
阅读全文
摘要:父组件 : <template> <!-- 1.展示why的个人信息 --> <show-info name="why" :age="18" :height="1.88" address="广州市" abc="cba" class="active" /> </template> <script> i
阅读全文
摘要:<body> <div id="app"> <home-nav></home-nav> <product-item></product-item> <product-item></product-item> <product-item></product-item> </div> <template
阅读全文

浙公网安备 33010602011771号