在学习vue,这是一个vue的列表搜索demo
涉及到的知识点:vfor,@click,computed,methods,vue中的数组操作
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>列表过滤</title>
</head>
<body>
<div id="box1">
<input type="text" v-model="searchName">
<ul>
<!-- 这里不能直接使用persons需要使用另一个过滤后的 -->
<li v-for="(p, index) in filterPersons" :key="index">
{
{index}}=={
{p.name}}=={
{p.age}}
</li>
</ul>
<button @click="setOrderType(1)">年龄升序</button>
<button @click="se