searchValue is not defined     at onUpdate:modelValue.a.<computed>.a.<computed>


本地测试没有问题,但是发布到线上就出现问题

searchValue is not defined     at onUpdate:modelValue.a.<computed>.a.<computed>

解决方法:

每个vue组件最多可以使用1个×<script>标记,最多可以使用1个×<script setup>

它们的输出将被合并,合并它们的隐式或显式导出所产生的对象在<template>中可用。

但它们之间没有联系。这意味着:不要期望两个script标记中的任何一个比另一个的import标记更具可见性。

要么

<script setup>

import Overwrite from "../components/Overwrite.vue";

const text = ref('')

</script>

要么

<script>

import Overwrite from "../components/Overwrite.vue";

export default { components: { Overwrite },

// you don't need `data` (which is Options API). use `setup` instead

setup: () => ({ text: ref('') }) }

</script>

这两种模式不能都存在,只能二选一定义参数

2 条评论

当前评论已经关闭


登录用户头像