mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-04-18 14:50:56 +08:00
build: add tusimple index
This commit is contained in:
parent
d00da51d06
commit
01a6a9fce4
@ -1,10 +1,11 @@
|
||||
# CHANGELOG
|
||||
## PENDING
|
||||
## 1.6.0
|
||||
### Fixes
|
||||
- Fix the problem that `n-auto-complete`'s menu can't be closed when use `textarea` as input.
|
||||
- Fix the problem that nested `n-icon` is not flattened.
|
||||
- Fix the problem that `n-date-picker` has no year in panel when type is `date` and `datetime`.
|
||||
### Features
|
||||
- `n-button` add `dashed` props
|
||||
- Add `n-space` component.
|
||||
- Make `n-drawer` content scrollable.
|
||||
### Localization
|
||||
|
@ -1,10 +1,11 @@
|
||||
# CHANGELOG
|
||||
## PENDING
|
||||
## 1.6.0
|
||||
### Fixes
|
||||
- 修正了 `n-auto-complete` 使用 `textarea` 作为输入元素时菜单无法关闭的问题
|
||||
- 修正了嵌套 `n-icon` 没有被打平的问题
|
||||
- 修正了 `n-date-picker` 在类型为 `date` 和 `datetime` 时面板不显示年的问题
|
||||
### Features
|
||||
- `n-button` 增加 `dashed` 属性
|
||||
- 增加 `n-space` 组件
|
||||
- `n-drawer` 内容可滚动
|
||||
### Localization
|
||||
|
5
build/webpack.tusimple-dev.js
Normal file
5
build/webpack.tusimple-dev.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = Object.assign(
|
||||
{},
|
||||
require('./webpack.dev'),
|
||||
{ entry: './demo/tusimple-dev-index.js' }
|
||||
)
|
5
build/webpack.tusimple-doc.js
Normal file
5
build/webpack.tusimple-doc.js
Normal file
@ -0,0 +1,5 @@
|
||||
module.exports = Object.assign(
|
||||
{},
|
||||
require('./webpack.doc'),
|
||||
{ entry: './demo/tusimple-deployment-index.js' }
|
||||
)
|
@ -5,9 +5,6 @@
|
||||
</n-alert>
|
||||
|
||||
## Customize Theme
|
||||
It is a experimental feature.
|
||||
|
||||
Let's continue, override the light theme on naive-ui instance.
|
||||
|
||||
```js
|
||||
// ...
|
||||
@ -25,4 +22,16 @@ naive.styles.light.override({
|
||||
Vue.use(naive)
|
||||
```
|
||||
|
||||
Done.
|
||||
For specific variables, please see source code.
|
||||
|
||||
### Use Tusimple Theme
|
||||
|
||||
```js
|
||||
// ...
|
||||
import tusimpleTheme from 'naive-ui/themes/tusimple'
|
||||
import naive from 'naive-ui'
|
||||
|
||||
naive.use(tusimpleTheme)
|
||||
|
||||
Vue.use(naive)
|
||||
```
|
@ -6,8 +6,6 @@
|
||||
|
||||
## 定制主题
|
||||
|
||||
这是一个试验性特性。
|
||||
|
||||
```js
|
||||
// ...
|
||||
|
||||
@ -16,12 +14,24 @@ import naive from 'naive-ui'
|
||||
naive.styles.light.override({
|
||||
derived: {
|
||||
primaryColor: 'rgb(255, 0, 0)',
|
||||
primaryHoverColor: 'rgb(0, 255, 0)',
|
||||
primaryActiveColor: 'rgb(0, 0, 255)'
|
||||
primaryColorHover: 'rgb(0, 255, 0)',
|
||||
primaryColorActive: 'rgb(0, 0, 255)'
|
||||
}
|
||||
})
|
||||
|
||||
Vue.use(naive)
|
||||
```
|
||||
|
||||
好了。
|
||||
具体可使用变量请参考源码。
|
||||
|
||||
### 使用图森主题
|
||||
|
||||
```js
|
||||
// ...
|
||||
import tusimpleTheme from 'naive-ui/theme/tusimple'
|
||||
import naive from 'naive-ui'
|
||||
|
||||
naive.use(tusimpleTheme)
|
||||
|
||||
Vue.use(naive)
|
||||
```
|
21
demo/tusimple-deployment-index.js
Normal file
21
demo/tusimple-deployment-index.js
Normal file
@ -0,0 +1,21 @@
|
||||
import { Vue, i18n } from './init'
|
||||
import hljs from './hljs'
|
||||
import demoRouterView from './DemoRouterView'
|
||||
import naive from '../lib/index'
|
||||
import './font'
|
||||
import createRouter from './routes/router'
|
||||
import { routes } from './routes/routes'
|
||||
import tusimpleTheme from '../themes/tusimple'
|
||||
|
||||
naive.setHljs(hljs)
|
||||
naive.use(tusimpleTheme)
|
||||
|
||||
Vue.use(naive)
|
||||
|
||||
const router = createRouter(Vue, routes)
|
||||
|
||||
new Vue({
|
||||
...demoRouterView,
|
||||
router,
|
||||
i18n
|
||||
}).$mount('#app')
|
@ -15,18 +15,19 @@
|
||||
"clean": "rm -rf lib && rm -rf es && rm -rf dist",
|
||||
"demo": "npm run generate && cross-env NODE_ENV=production webpack-dev-server --config build/webpack.demo.js",
|
||||
"dev": "npm run generate && cross-env NODE_ENV=development webpack-dev-server --config build/webpack.dev.js",
|
||||
"dev:design": "npm run generate && cross-env NODE_ENV=development webpack-dev-server --config build/webpack.dev-design.js",
|
||||
"lint": "eslint --no-error-on-unmatched-pattern --fix \"src/**/*.{js,vue}\" \"test/**/*.{js,vue}\" \"build/**/*.{js,vue}\" \"demo/**/*.{js,vue}\" && stylelint \"src/_styles/**/*.scss\"",
|
||||
"lint:js": "eslint --no-error-on-unmatched-pattern --fix \"src/**/*.{js,vue}\" \"test/**/*.{js,vue}\" \"build/**/*.{js,vue}\" \"demo/**/*.{js,vue}\"",
|
||||
"lint:style": "stylelint \"src/_styles/**/*.scss\"",
|
||||
"release:doc": "npm run build:doc && node build-doc/generate-deploy-sh.js &&sudo bash build-doc/deploy-doc.sh",
|
||||
"release:doc:no-build": "node build-doc/generate-deploy-sh.js && sudo bash build-doc/deploy-doc.sh",
|
||||
"release:package": "npm run build && npm publish",
|
||||
"test": "cross-env NODE_ENV=test jest",
|
||||
"init-cssr": "node scripts/create-cssr-scaffold.js",
|
||||
"generate": "npm run generate-version && npm run generate-global-style",
|
||||
"generate-version": "node scripts/generate-version",
|
||||
"generate-global-style": ""
|
||||
"generate-global-style": "",
|
||||
"tusimple:dev": "npm run generate && cross-env NODE_ENV=development webpack-dev-server --config build/webpack.tusimple-dev.js",
|
||||
"tusimple:build:doc": "npm run generate && npm run build && rm -rf build-doc/dist && cross-env NODE_ENV=production webpack --config build/webpack.tusimple-doc.js",
|
||||
"tusimple:release:doc": "npm run tusimple:build:doc && node build-doc/generate-deploy-sh.js && sudo bash build-doc/deploy-doc.sh",
|
||||
"tusimple:release:doc:no-build": "node build-doc/generate-deploy-sh.js && sudo bash build-doc/deploy-doc.sh"
|
||||
},
|
||||
"author": "lecong.zhang",
|
||||
"license": "MIT",
|
||||
|
@ -6,8 +6,12 @@ import { composite } from '../src/_utils/color'
|
||||
function tusimpleTheme (naive) {
|
||||
naive.avoidHollowOut = true
|
||||
naive.styles.light.override({
|
||||
base: {
|
||||
borderRadius: '16px'
|
||||
},
|
||||
derived: {
|
||||
borderColor: '#999',
|
||||
divider: '#EBEDF0',
|
||||
primaryColor: '#4FB233',
|
||||
primaryColorHover: composite('#4FB233', 'rgba(255, 255, 255, .2)'),
|
||||
primaryColorPressed: composite('#4FB233', 'rgba(0, 0, 0, .15)'),
|
||||
@ -23,7 +27,8 @@ function tusimpleTheme (naive) {
|
||||
warningColor: '#FFAC26',
|
||||
warningColorHover: composite('#FFAC26', 'rgba(255, 255, 255, .2)'),
|
||||
warningColorPressed: composite('#FFAC26', 'rgba(0, 0, 0, .05)'),
|
||||
textColorSecondary: '#333'
|
||||
textColorSecondary: '#333',
|
||||
tableHeaderColorOverlay: '#EBEDF0'
|
||||
}
|
||||
})
|
||||
naive.styles.light.Button.override({
|
||||
@ -87,6 +92,9 @@ function tusimpleTheme (naive) {
|
||||
iconMarginMedium: '8px',
|
||||
iconMarginLarge: '12px'
|
||||
})
|
||||
naive.styles.light.Tag.override({
|
||||
borderRadius: '16px'
|
||||
})
|
||||
}
|
||||
|
||||
tusimpleTheme.install = tusimpleTheme
|
||||
|
Loading…
x
Reference in New Issue
Block a user