Skip to content

Commit

Permalink
feat: add blocks (#1918)
Browse files Browse the repository at this point in the history
  • Loading branch information
kagol authored Aug 15, 2024
1 parent 09efdec commit 5f52440
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/blocks/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local
package-lock.json

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
10 changes: 10 additions & 0 deletions examples/blocks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Blocks

使用 TinyVue 组件搭建出来的区块。

## 本启启动

```shell
pnpm i
pnpm -F blocks dev
```
53 changes: 53 additions & 0 deletions examples/blocks/components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

declare module 'vue' {
export interface GlobalComponents {
RouterLink: (typeof import('vue-router'))['RouterLink']
RouterView: (typeof import('vue-router'))['RouterView']
TinyActionSheet: (typeof import('@opentiny/vue'))['ActionSheet']
TinyAlert: (typeof import('@opentiny/vue'))['Alert']
TinyBaseSelect: (typeof import('@opentiny/vue'))['BaseSelect']
TinyButton: (typeof import('@opentiny/vue'))['Button']
TinyCascaderSelect: (typeof import('@opentiny/vue'))['CascaderSelect']
TinyCell: (typeof import('@opentiny/vue'))['Cell']
TinyCheckbox: (typeof import('@opentiny/vue'))['Checkbox']
TinyCheckboxGroup: (typeof import('@opentiny/vue'))['CheckboxGroup']
TinyCol: (typeof import('@opentiny/vue'))['Col']
TinyCustomSwitch: (typeof import('@opentiny/vue'))['CustomSwitch']
TinyDialogBox: (typeof import('@opentiny/vue'))['DialogBox']
TinyDropdown: (typeof import('@opentiny/vue'))['Dropdown']
TinyDropdownItem: (typeof import('@opentiny/vue'))['DropdownItem']
TinyDropdownMenu: (typeof import('@opentiny/vue'))['DropdownMenu']
TinyException: (typeof import('@opentiny/vue'))['Exception']
TinyFilterBox: (typeof import('@opentiny/vue'))['FilterBox']
TinyGrid: (typeof import('@opentiny/vue'))['Grid']
TinyGridColumn: (typeof import('@opentiny/vue'))['GridColumn']
TinyInput: (typeof import('@opentiny/vue'))['Input']
TinyLayout: (typeof import('@opentiny/vue'))['Layout']
TinyModal: (typeof import('@opentiny/vue'))['Modal']
TinyOption: (typeof import('@opentiny/vue'))['Option']
TinyOptionGroup: (typeof import('@opentiny/vue'))['OptionGroup']
TinyPager: (typeof import('@opentiny/vue'))['Pager']
TinyPopover: (typeof import('@opentiny/vue'))['Popover']
TinyRadio: (typeof import('@opentiny/vue'))['Radio']
TinyRadioGroup: (typeof import('@opentiny/vue'))['RadioGroup']
TinyRecycleScroller: (typeof import('@opentiny/vue'))['RecycleScroller']
TinyRow: (typeof import('@opentiny/vue'))['Row']
TinySearch: (typeof import('@opentiny/vue'))['Search']
TinySelect: (typeof import('@opentiny/vue'))['Select']
TinySelectedBox: (typeof import('@opentiny/vue'))['SelectedBox']
TinySplit: (typeof import('@opentiny/vue'))['Split']
TinyTabItem: (typeof import('@opentiny/vue'))['TabItem']
TinyTabs: (typeof import('@opentiny/vue'))['Tabs']
TinyTagGroup: (typeof import('@opentiny/vue'))['TagGroup']
TinyTimePickerMobile: (typeof import('@opentiny/vue'))['TimePickerMobile']
TinyTooltip: (typeof import('@opentiny/vue'))['Tooltip']
TinyTree: (typeof import('@opentiny/vue'))['Tree']
TinyUserHead: (typeof import('@opentiny/vue'))['UserHead']
}
}
12 changes: 12 additions & 0 deletions examples/blocks/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TinyVue 区块</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
22 changes: 22 additions & 0 deletions examples/blocks/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "blocks",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@opentiny/vue": "~3.18.0",
"vue": "^3.3.11"
},
"devDependencies": {
"@opentiny/unplugin-tiny-vue": "~0.0.2",
"@vitejs/plugin-vue": "^4.5.2",
"typescript": "^5.2.2",
"vite": "^5.0.8",
"vue-tsc": "^1.8.25"
}
}
9 changes: 9 additions & 0 deletions examples/blocks/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<script setup lang="ts">
import BlockDemo from './blocks/BlockDemo.vue'
</script>

<template>
<BlockDemo />
</template>

<style scoped></style>
8 changes: 8 additions & 0 deletions examples/blocks/src/blocks/BlockDemo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script setup lang="ts"></script>

<template>
<tiny-button>确定</tiny-button>
<tiny-alert description="描述信息"></tiny-alert>
</template>

<style scoped></style>
5 changes: 5 additions & 0 deletions examples/blocks/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'

createApp(App).mount('#app')
Empty file added examples/blocks/src/style.css
Empty file.
1 change: 1 addition & 0 deletions examples/blocks/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
25 changes: 25 additions & 0 deletions examples/blocks/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }]
}
10 changes: 10 additions & 0 deletions examples/blocks/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
17 changes: 17 additions & 0 deletions examples/blocks/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import autoImportPlugin from '@opentiny/unplugin-tiny-vue'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), autoImportPlugin('vite')],
resolve: {
alias: [
// XDesign 主题
{
find: /\@opentiny\/vue-theme\/(?!(smb))/,
replacement: '@opentiny/vue-theme/smb-theme/'
}
]
}
})

0 comments on commit 5f52440

Please sign in to comment.