让我欢喜让我忧
改成Composition API:组合式 API的代码,
<template>
<!-- start -->
<span class="span_checkbox">操作<input type="checkbox" v-model="showInput" value="操作" /></span>
<div class="textarea_div" v-if="showInput">
<textarea
class="LiuYanBan_textarea"
name="LiuYanBan_textarea"
rows="1"
cols="60%"
placeholder="请输入留言内容"
v-model="value"
></textarea>
<button @click="sub" class="nav_btn">提交</button>
</div>
<nav>
<ul>
<sub>虽然有点乱,但也记录了很多新知识</sub>
<li v-for="(item, index) in msg" :key="index">
<span v-if="showInput" @click="del(index)" value="删除">删除</span>
<span v-if="showInput" @click="edit_bianju(index)">编辑</span>
<span v-show="oindex == index ? true : false">
<textarea v-model="value">&l