1.主要内容
1.模板插值{
{}}
2.v-model变量双向绑定
3.v-show:DOM元素的显示与隐藏
4.v-if:DOM元素的渲染与不渲染
5.v-for循环、class样式绑定、style绑定、click绑定
6.子父组件传参props、$emit、$refs:
1)父组件
<template>
<div style="margin: 15px">
<div class="item">
<div style="margin-bottom: 20px">
1、 当前用户名:{
{
userName }},当前时间:{
{
date }}
</div>
<el-row>
<el-button @click="getUserName(true)">调用后台接口</el-button>
<el-button type="primary">主要按钮</el-button>
<el-button type="success">成功按钮</el-button>
<el-button type="info">信息按钮</el-button>
<el-button type="warning">警告按钮</el-button>
<el-button type="danger">危险按钮</el-button>
</el-row>
</div>
<!-- v-model -->
<div class="item">
2、 v-model:
<el-input style="width: 200px" v-model="inputVal"></el-input>
<span>{
{
inputVal }}</span>
</div>
<!-- v-show -->
<div class="item">
3、
<el-button size="small" type="primary" @click="showVal = !showVal"
>v-show</el-button

最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



