Commit 237504d7 authored by 张俊's avatar 张俊

vue3写法

parent 325fbce8
...@@ -57,14 +57,11 @@ ...@@ -57,14 +57,11 @@
</template> </template>
<script setup> <script setup>
import { reactive, toRefs, ref, } from '@vue/reactivity' import { reactive, ref,onBeforeMount,toRefs,computed,watch } from 'vue'
import { getCurrentInstance } from 'vue'
import { computed, onBeforeMount, watch } from '@vue/runtime-core'
import { useRouter } from 'vue-router'; import { useRouter } from 'vue-router';
import bgTable from '@/bg-ui/bg-table.vue' import bgTable from '@/bg-ui/bg-table.vue'
// const bgTable = ref(null) import { ElMessage } from 'element-plus'
const { proxy } = getCurrentInstance() import axios from '../../../../request/http.js'
const { $message, $axios } = proxy
const state = reactive({ const state = reactive({
typeList: [ typeList: [
{ {
...@@ -142,7 +139,7 @@ const getTypeList = () => { ...@@ -142,7 +139,7 @@ const getTypeList = () => {
} }
const getTableRows = () => { const getTableRows = () => {
let params = {...state.filter} let params = {...state.filter}
$axios axios
.get( .get(
`/apaas/system/v5/dictionary/list`, `/apaas/system/v5/dictionary/list`,
{ {
...@@ -154,7 +151,7 @@ const getTableRows = () => { ...@@ -154,7 +151,7 @@ const getTableRows = () => {
state.tableRows = res.data.data || [] state.tableRows = res.data.data || []
state.tableTotal = res.data.total state.tableTotal = res.data.total
}else { }else {
$message.error(res.data.msg) ElMessage.error(res.data.msg)
} }
}) })
} // 获取数据 } // 获取数据
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment