The setup record
Child components pass values to parent components
emits: ["refreshDataList"],
setup(props, context) {
let refreshDataList = () => {
context.emit("refreshDataList");
};
return {
refreshDataList
};
},
Copy the code
Gets the props pass value
props: [ 'echartsId', 'eWidth', 'eHeight', 'theme', 'options', 'lineColor' ], Setup (props) {// Get props from setup console.log('props', props. EchartsId, props. EWidth)},Copy the code
Obtain VUEX data
setup(){ const store = useStore (); // console.log(' test ', store.getters.modeflag) return {barTitle:computed(() => store.getters.bartitle)}},Copy the code
Observable setup custom properties
setup(props) {
let docEcharts = ref();
docEcharts.value = 0
docEcharts.value ++
return {
docEcharts,
}
},
Copy the code