Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: 优化了性能 #149

Merged
merged 1 commit into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/src/data/Quick/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import handler, { QUICK_TYPE } from './handler'
import Quick from './Pane.vue'

const Quick = defineAsyncComponent(() => import('./Pane.vue'))

export default {
type: QUICK_TYPE,
Expand Down
6 changes: 3 additions & 3 deletions examples/src/data/Rest/index.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { RequestMethod, RestHandler } from '@open-data-v/data'
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import { apiHttp as http } from '@/utils/http'
import { uuid } from '@/utils/utils'

import DataView from './Pane.vue'

class RestRequestHandler extends RestHandler {
constructor(options) {
const connector = http
super(options, connector)
}
}

const DataView = defineAsyncComponent(() => import('./Pane.vue'))

export default {
type: 'REST',
name: '动态数据',
Expand Down
7 changes: 4 additions & 3 deletions packages/data/src/rest/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import { uuid } from '../utils'
import RestHandler from './handler'
import RestPane from './Pane.vue'
import { RequestMethod } from './requestEnums'
import RestContent from './RestDataView.vue'
import type { RestOption, RestResponse } from './type'
import { KVToRecordable, recordabletoKV, requestOptionsToStore } from './utils'

const RestPane = defineAsyncComponent(() => import('./Pane.vue'))
const RestContent = defineAsyncComponent(() => import('./RestDataView.vue'))

export default {
type: 'REST',
name: '动态数据',
Expand Down
7 changes: 4 additions & 3 deletions packages/data/src/static/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import StaticContent from './DataView.vue'
import handler from './handler'
import StaticPane from './Pane.vue'

const StaticPane = defineAsyncComponent(() => import('./Pane.vue'))
const StaticContent = defineAsyncComponent(() => import('./DataView.vue'))

export default {
type: 'STATIC',
Expand Down
7 changes: 4 additions & 3 deletions packages/data/src/sub/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import handler from './handler'
import SubPane from './Pane.vue'
import Subontent from './SubDataView.vue'

const Subontent = defineAsyncComponent(() => import('./SubDataView.vue'))
const SubPane = defineAsyncComponent(() => import('./Pane.vue'))

export default {
type: 'SUB',
Expand Down
7 changes: 4 additions & 3 deletions packages/data/src/websocket/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import handler from './handler'
import WebSocketPane from './Pane.vue'
import type { WebsocketOption } from './type'
import WebSocketContent from './WebsocketView.vue'

const WebSocketContent = defineAsyncComponent(() => import('./WebsocketView.vue'))
const WebSocketPane = defineAsyncComponent(() => import('./Pane.vue'))

export default {
type: 'WS',
Expand Down
5 changes: 3 additions & 2 deletions packages/designer/src/data/DemoData/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import DemoRequestData from './handler'
import DemoPane from './Pane.vue'

const DemoPane = defineAsyncComponent(() => import('./Pane.vue'))

export default {
type: 'DEMO',
Expand Down
5 changes: 3 additions & 2 deletions packages/scripts/src/custom/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import ScriptHandler from './handler'
import { makeFunction } from './utils'
import View from './View.vue'

const View = defineAsyncComponent(() => import('./View.vue'))

export default {
type: 'Custom',
Expand Down
5 changes: 3 additions & 2 deletions packages/scripts/src/system/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { shallowRef } from 'vue'
import { defineAsyncComponent, shallowRef } from 'vue'

import ScriptHandler from './handler'
import funcs from './scripts'
import View from './View.vue'

const View = defineAsyncComponent(() => import('./View.vue'))

export default {
type: 'System',
Expand Down