-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add vue-router support
- Loading branch information
Showing
30 changed files
with
553 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/examples | ||
/src | ||
/src | ||
/templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
# umi-plugin | ||
|
||
### template | ||
|
||
* [create-umi-vue](https://www.npmjs.com/package/create-umi-vue) | ||
|
||
### plugins | ||
|
||
* [@ddot/umi-plugin-service](https://www.npmjs.com/package/@ddot/umi-plugin-service) | ||
* [@ddot/umi-plugin-vue](https://www.npmjs.com/package/@ddot/umi-plugin-vue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": ["plugin:vue/essential"] | ||
} | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,5 @@ | |
**/*.ejs | ||
**/*.html | ||
dist | ||
package.json | ||
.umi | ||
.umi-production |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"private": true, | ||
"scripts": { | ||
"start": "umi dev", | ||
"build": "umi build", | ||
"test": "umi test", | ||
"lint": "pretty-quick --staged" | ||
}, | ||
"devDependencies": { | ||
"@ddot/umi-plugin-vue": "^0.0.2", | ||
"eslint": "^5.6.0", | ||
"eslint-plugin-vue": "^5.0.0-beta.3", | ||
"husky": "^1.0.0-rc.14", | ||
"prettier": "^1.14.2", | ||
"pretty-quick": "^1.6.0", | ||
"umi": "^2.0.3" | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "yarn lint" | ||
} | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
html { | ||
background: #fff; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<router-view></router-view> | ||
</template> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# umi-plugin-vue | ||
[![NPM version](https://img.shields.io/npm/v/@ddot/umi-plugin-vue.svg?style=flat-square)](https://npmjs.org/package/@ddot/umi-plugin-vue) | ||
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier) | ||
[![MIT](https://img.shields.io/dub/l/vibe-d.svg?style=flat-square)](http://opensource.org/licenses/MIT) | ||
|
||
|
||
`umi`服务接口插件。 | ||
|
||
## 配置 | ||
|
||
**.umirc.js** | ||
|
||
```js | ||
export default { | ||
plugins: [ | ||
[ | ||
'@ddot/umi-plugin-vue' | ||
] | ||
] | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var assert = require("assert"); | ||
function default_1(routes, excludes) { | ||
function exclude(routes) { | ||
return routes.filter(function(route) { | ||
for (var _i = 0, excludes_1 = excludes; _i < excludes_1.length; _i++) { | ||
var exclude_1 = excludes_1[_i]; | ||
assert( | ||
typeof exclude_1 === "function" || exclude_1 instanceof RegExp, | ||
"exclude should be function or RegExp" | ||
); | ||
if (typeof exclude_1 === "function" && exclude_1(route)) { | ||
return false; | ||
} | ||
if ( | ||
!route.component.startsWith("() =>") && | ||
exclude_1 instanceof RegExp && | ||
exclude_1.test(route.component) | ||
) { | ||
return false; | ||
} | ||
} | ||
if (route.children) { | ||
route.children = exclude(route.children); | ||
} | ||
return true; | ||
}); | ||
} | ||
return exclude(routes); | ||
} | ||
exports.default = default_1; |
Oops, something went wrong.