@opentiny/vue-docs 2.1.4 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ const step = ref({
20
20
  hour: 2,
21
21
  minute: 5
22
22
  })
23
- const value = ref([])
23
+ const value = ref('')
24
24
  </script>
25
25
 
26
26
  <style scoped>
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div>
3
+ <tiny-grid :data="tableData" :edit-config="{ trigger: 'click', mode: 'row', showStatus: true }">
4
+ <tiny-grid-column type="index" width="60"></tiny-grid-column>
5
+ <tiny-grid-column field="name" title="插槽自定义列编辑" :editor="{ component: 'input', autoselect: true }">
6
+ <template #edit="data">
7
+ <tiny-input v-model="data.row.name" placeholder="请输入内容"></tiny-input>
8
+ </template>
9
+ </tiny-grid-column>
10
+ <tiny-grid-column field="employees" title="员工人数"></tiny-grid-column>
11
+ <tiny-grid-column field="area" title="所属区域"></tiny-grid-column>
12
+ <tiny-grid-column field="address" title="地址"></tiny-grid-column>
13
+ <tiny-grid-column field="introduction" title="公司简介" show-overflow></tiny-grid-column>
14
+ </tiny-grid>
15
+ </div>
16
+ </template>
17
+
18
+ <script>
19
+ import { ref } from 'vue'
20
+ import { Grid as TinyGrid, GridColumn as TinyGridColumn, Input as TinyInput } from '@opentiny/vue'
21
+
22
+ const tableData = ref([
23
+ {
24
+ id: '1',
25
+ name: 'GFD科技YX公司',
26
+ area: '华东区',
27
+ address: '福州',
28
+ introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
29
+ },
30
+ {
31
+ id: '2',
32
+ name: 'WWW科技YX公司',
33
+ area: '华南区',
34
+ address: '深圳福田区',
35
+ introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
36
+ },
37
+ {
38
+ id: '3',
39
+ name: 'RFV有限责任公司',
40
+ area: '华南区',
41
+ address: '中山市',
42
+ introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
43
+ },
44
+ {
45
+ id: '4',
46
+ name: 'TGB科技YX公司',
47
+ area: '华东区',
48
+ address: '龙岩',
49
+ introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
50
+ },
51
+ {
52
+ id: '5',
53
+ name: 'YHN科技YX公司',
54
+ area: '华南区',
55
+ address: '韶关',
56
+ introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
57
+ },
58
+ {
59
+ id: '6',
60
+ name: 'WSX科技YX公司',
61
+ area: '华中区',
62
+ address: '黄冈',
63
+ introduction: '公司技术和研发实力雄厚,是国家863项目的参与者,并被政府认定为“高新技术企业”。'
64
+ }
65
+ ])
66
+ </script>
@@ -128,7 +128,7 @@ export default {
128
128
  },
129
129
  {
130
130
  'demoId': 'size-medium',
131
- 'name': { 'zh-CN': 'select', 'en-US': 'small' },
131
+ 'name': { 'zh-CN': '尺寸', 'en-US': 'small' },
132
132
  'desc': {
133
133
  'zh-CN':
134
134
  '<p>通过 <code>size</code> 属性定义输入框尺寸,可选项有 medium、small、mini 。\n通过 <code>options</code> 配置 Select 数据项,使用后不需要再配置 tiny-option。</p>\n',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-docs",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
4
4
  "dependencies": {
5
5
  "@unocss/reset": "0.38.2",
6
6
  "@vue/repl": "^2.5.5",
@@ -15,17 +15,17 @@
15
15
  "marked": "^4.3.0",
16
16
  "@playwright/test": "^1.29.2",
17
17
  "sortablejs": "1.15.0",
18
- "@opentiny/vue-repl": "^1.0.2",
19
- "@opentiny/vue": "~3.11.0",
18
+ "@opentiny/vue-repl": "^1.1.0",
20
19
  "@opentiny/vue-common": "~3.11.0",
21
- "@opentiny/vue-design-aurora": "~3.11.0",
22
- "@opentiny/vue-icon-saas": "~3.11.0",
23
- "@opentiny/vue-theme": "~3.11.0",
20
+ "@opentiny/vue": "~3.11.0",
24
21
  "@opentiny/vue-icon": "~3.11.0",
25
- "@opentiny/vue-design-smb": "~3.11.0",
26
- "@opentiny/vue-vite-import": "~1.1.5",
22
+ "@opentiny/vue-icon-saas": "~3.11.0",
23
+ "@opentiny/vue-design-aurora": "~3.11.0",
27
24
  "@opentiny/vue-theme-mobile": "~3.11.0",
28
- "@opentiny/vue-theme-saas": "~3.11.0"
25
+ "@opentiny/vue-design-smb": "~3.11.0",
26
+ "@opentiny/vue-theme": "~3.11.0",
27
+ "@opentiny/vue-theme-saas": "~3.11.0",
28
+ "@opentiny/vue-vite-import": "~1.1.5"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/markdown-it": "^12.2.3",
@@ -13,8 +13,7 @@ import Share from './icons/Share.vue'
13
13
 
14
14
  const versions = ['3.11', '3.10', '3.9', '3.8']
15
15
  const latestVersion = versions[0]
16
- const cdnHost = 'https://unpkg.com'
17
- window.localStorage.setItem('setting-cdn', cdnHost)
16
+ const cdnHost = window.localStorage.getItem('setting-cdn')
18
17
 
19
18
  const searchObj = new URLSearchParams(location.search)
20
19
  const tinyMode = searchObj.get('mode')
package/playground.html CHANGED
@@ -5,6 +5,10 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vite + Vue</title>
8
+ <script>
9
+ const cdnHost = 'https://unpkg.com'
10
+ window.localStorage.setItem('setting-cdn', cdnHost)
11
+ </script>
8
12
  </head>
9
13
  <body>
10
14
  <div id="app"></div>
@@ -64,7 +64,7 @@
64
64
  <tbody>
65
65
  <tr v-for="row in oneApiArr" :key="row.name">
66
66
  <td>
67
- <a v-if="row.demoId" :href="`#${row.demoId}`">{{ row.name }}</a>
67
+ <a v-if="row.demoId" @click="jumpToDemo(row.demoId)">{{ row.name }}</a>
68
68
  <span v-else>{{ row.name }}</span>
69
69
  </td>
70
70
  <td v-if="!key.includes('slots')"><span v-html="row.type"></span></td>
@@ -261,6 +261,13 @@ export default defineComponent({
261
261
  copyText: (text) => {
262
262
  navigator.clipboard.writeText(text)
263
263
  },
264
+ jumpToDemo: (demoId) => {
265
+ if (demoId.startsWith('chart') || demoId.startsWith('grid')) {
266
+ router.push(demoId)
267
+ } else {
268
+ router.push(`#${demoId}`)
269
+ }
270
+ },
264
271
  handleApiClick: (ev) => {
265
272
  if (ev.target.tagName === 'A') {
266
273
  ev.preventDefault()
package/vite.config.ts CHANGED
@@ -69,9 +69,6 @@ export default defineConfig((config) => {
69
69
  targets: copyTarget
70
70
  })
71
71
  ],
72
- define: {
73
- 'process.env': {}
74
- },
75
72
  optimizeDeps: getOptimizeDeps(3),
76
73
  build: {
77
74
  rollupOptions: {
@@ -116,5 +113,11 @@ export default defineConfig((config) => {
116
113
  }
117
114
  }
118
115
 
116
+ if (env.NODE_ENV === 'development') {
117
+ viteConfig.define = {
118
+ 'process.env': {}
119
+ }
120
+ }
121
+
119
122
  return viteConfig
120
123
  })