怎么修改和获取数据呢
我想用root(this)获取,但是弃用了,虽然弃用但是可以用,那以后该怎么用呢
我这么用
import { useStore } from 'vuex'
...
const store = useStore()
也报错了
请问正确的该怎么使用呢
o,对,没有this,
就是setup(props, {root}) {}
跳转页面的没法做到
怎么修改和获取数据呢
我想用root(this)获取,但是弃用了,虽然弃用但是可以用,那以后该怎么用呢
我这么用
import { useStore } from 'vuex'
...
const store = useStore()
也报错了
请问正确的该怎么使用呢
o,对,没有this,
就是setup(props, {root}) {}
跳转页面的没法做到
import {computed} from '@vue/composition-api';
const val = computed(mapGetters('xx').xx); // 获取响应值
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.6k 阅读✓ 已解决
3 回答5.1k 阅读✓ 已解决
3 回答1.8k 阅读✓ 已解决
直接用store.state/store.commit/store.dispatch就可以了
或者你可以直接用pinia