feat:更新

This commit is contained in:
dengtongyu committed 2023-12-03 21:47:40 +08:00
1 parent 5bc01ab257
commit caf4fd2b86
55 files changed
+2666 -210

No files matched your search

+10 -9
View File
@@ -6,12 +6,13 @@
</select>
<button @click="watchStop">停止侦听</button>
</p>
<br />
<p>{{ res }}</p>
</div>
</template>
<script setup lang="ts">
import { watch, ref } from 'vue'
import { watch, ref } from "vue";
const options = [
{
label: "第一页",
@@ -33,20 +34,20 @@ const options = [
label: "第五页",
value: 5
}
]
const curPage = ref(1)
const res = ref("")
];
const curPage = ref(1);
const res = ref("");
const stop = watch(
curPage,
(newValue) => {
const curItem = options.filter((item) => item.value === newValue)[0]
res.value = `${curItem.label} 的数据`
const curItem = options.filter((item) => item.value === newValue)[0];
res.value = `${curItem.label} 的数据`;
}
)
);
const watchStop = () => {
stop()
}
stop();
};