-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
660 additions
and
58 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
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,23 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
package-lock.json |
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 @@ | ||
registry = 'https://registry.npmjs.org' |
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,24 @@ | ||
# vue | ||
|
||
## Project setup | ||
``` | ||
npm install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
``` | ||
npm run serve | ||
``` | ||
|
||
### Compiles and minifies for production | ||
``` | ||
npm run build | ||
``` | ||
|
||
### Lints and fixes files | ||
``` | ||
npm run lint | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). |
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 @@ | ||
module.exports = { | ||
presets: ['@vue/cli-plugin-babel/preset'], | ||
}; |
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 @@ | ||
const { exec } = require('child_process'); | ||
|
||
[ | ||
'@garfish/core', | ||
'@garfish/router', | ||
'@garfish/browser-snapshot', | ||
'@garfish/browser-vm', | ||
'@garfish/core', | ||
'@garfish/loader', | ||
'@garfish/cjs-app', | ||
].forEach((item) => { | ||
console.log(`link ${item}`); | ||
exec(`yarn link ${item}`, (error, stdout, stderr) => { | ||
if (error) { | ||
console.error(`执行的错误: ${error}`); | ||
return; | ||
} | ||
stdout && console.log(`stdout: ${stdout}`); | ||
stderr && console.error(`stderr: ${stderr}`); | ||
}); | ||
}); |
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,42 @@ | ||
{ | ||
"name": "vue", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"start": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
"dependencies": { | ||
"core-js": "^3.6.5", | ||
"element-ui": "^2.14.1", | ||
"vue": "^2.6.11", | ||
"vue-router": "^3.4.3", | ||
"vuex": "^3.5.1", | ||
"@garfish/core": "0.0.8-alpha.5" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~4.4.0", | ||
"@vue/cli-plugin-eslint": "~4.4.0", | ||
"@vue/cli-service": "~4.4.0", | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.7.2", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"vue-template-compiler": "^2.6.11" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true, | ||
"browser": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
}, | ||
"rules": {} | ||
} | ||
} |
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 @@ | ||
console.log('async'); | ||
|
||
throw 121; |
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 @@ | ||
body { | ||
margin: 10px; | ||
background: url(../../favicon.ico) no-repeat; | ||
} |
Binary file not shown.
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,69 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href=/asdf.png> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<!-- <link rel="stylesheet" href="<%= BASE_URL %>/css/xxx/xx.css"> --> | ||
<style> | ||
#MainApp { | ||
background-color: #5692ce; | ||
} | ||
</style> | ||
<script> | ||
window.addEventListener('unhandledrejection', event => { | ||
event.promise.catch((e)=>{ | ||
if (e instanceof Error) { | ||
console.log('vue app get error:', event); // 捕获后自定义处理 | ||
}else { | ||
console.log(e); | ||
} | ||
}) | ||
console.log('vue app get error:', event); | ||
}, true); | ||
window.addEventListener('error', event => { | ||
console.log('vue app get error:', event); // 捕获后自定义处理 | ||
}, true); | ||
</script> | ||
<script type="module"> | ||
import a from 'http://localhost:9090/module.js'; | ||
</script> | ||
<!-- <title><%= htmlWebpackPlugin.options.title %></title> --> | ||
</head> | ||
<script> | ||
// console.log(document.getElementById('subVue'), document.head, 'document.head'); | ||
</script> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
<img src="xxx" /> | ||
<video src="1xxx" ></video> | ||
<div> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"> | ||
<g fill="none" fill-rule="evenodd"> | ||
<path d="M0 0H20V20H0z"/> | ||
<path fill="currentColor" d="M10 .833c5.063 0 9.167 4.104 9.167 9.167S15.063 19.167 10 19.167.833 15.063.833 10 4.937.833 10 .833zM10 2.5c-4.142 0-7.5 3.358-7.5 7.5 0 4.142 3.358 7.5 7.5 7.5 4.142 0 7.5-3.358 7.5-7.5 0-4.142-3.358-7.5-7.5-7.5zM8.14 5.69l1.768 1.768 1.767-1.768c.163-.162.427-.162.59 0l.589.59c.163.162.163.426 0 .589l-2.068 2.067h2.13c.23 0 .417.187.417.417v.833c0 .23-.186.417-.416.417h-2.084v1.064h2.084c.23 0 .416.186.416.416v.834c0 .23-.186.416-.416.416h-2.084v1.25c0 .23-.186.417-.416.417h-.834c-.23 0-.416-.187-.416-.417v-1.25H7.083c-.23 0-.416-.186-.416-.416v-.834c0-.23.186-.416.416-.416h2.084v-1.064H7.083c-.23 0-.416-.187-.416-.417v-.833c0-.23.186-.417.416-.417h1.945l-.004-.005L6.96 6.87c-.162-.163-.162-.427 0-.59l.59-.589c.162-.162.426-.162.589 0z"/> | ||
</g> | ||
</svg> | ||
</div> | ||
</body> | ||
<script> | ||
// console.log('test', document.currentScript); | ||
// setTimeout(() => { | ||
// console.log('test2', document.currentScript); | ||
// }) | ||
// b = 2; | ||
// window.onload = function(e) { | ||
// console.log('onload', e); | ||
// } | ||
// window.onerror = function (...args) { | ||
// console.log('vue app get error:', ...args); | ||
// } | ||
</script> | ||
<!-- <script src="<%= BASE_URL %>xxxasync.js" async></script> --> | ||
</html> |
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 @@ | ||
const a = { | ||
esmodule: true, | ||
}; | ||
export default a; |
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,53 @@ | ||
<template> | ||
<div id="app"> | ||
<img alt="Vue logo" src="./assets/logo.png"> | ||
<div> | ||
<router-link to="/">Home </router-link><br /> | ||
<router-link to="/todo">Go to Foo</router-link> | ||
</div> | ||
<router-view /> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"> | ||
<g fill="none" fill-rule="evenodd"> | ||
<path d="M0 0H20V20H0z"/> | ||
<path fill="currentColor" d="M10 .833c5.063 0 9.167 4.104 9.167 9.167S15.063 19.167 10 19.167.833 15.063.833 10 4.937.833 10 .833zM10 2.5c-4.142 0-7.5 3.358-7.5 7.5 0 4.142 3.358 7.5 7.5 7.5 4.142 0 7.5-3.358 7.5-7.5 0-4.142-3.358-7.5-7.5-7.5zM8.14 5.69l1.768 1.768 1.767-1.768c.163-.162.427-.162.59 0l.589.59c.163.162.163.426 0 .589l-2.068 2.067h2.13c.23 0 .417.187.417.417v.833c0 .23-.186.417-.416.417h-2.084v1.064h2.084c.23 0 .416.186.416.416v.834c0 .23-.186.416-.416.416h-2.084v1.25c0 .23-.186.417-.416.417h-.834c-.23 0-.416-.187-.416-.417v-1.25H7.083c-.23 0-.416-.186-.416-.416v-.834c0-.23.186-.416.416-.416h2.084v-1.064H7.083c-.23 0-.416-.187-.416-.417v-.833c0-.23.186-.417.416-.417h1.945l-.004-.005L6.96 6.87c-.162-.163-.162-.427 0-.59l.59-.589c.162-.162.426-.162.589 0z"/> | ||
</g> | ||
</svg> | ||
<el-button | ||
plain | ||
@click="open1"> | ||
可自动关闭 | ||
</el-button> | ||
<div id="vueApp"></div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'App', | ||
methods: { | ||
open1() { | ||
// const h = this.$createElement; | ||
throw new Error('vue sub app error') | ||
// this.$notify({ | ||
// title: '标题名称', | ||
// message: h('i', { style: 'color: teal'}, '这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案这是提示文案') | ||
// }); | ||
} | ||
}, | ||
components: { | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
#app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
color: #2c3e50; | ||
margin-top: 60px; | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,35 @@ | ||
<template> | ||
<div class="hello"> | ||
<h1>{{ msg }}</h1> | ||
<p> | ||
Thank you for using Gar | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'HelloWorld', | ||
props: { | ||
msg: String | ||
} | ||
} | ||
</script> | ||
|
||
<!-- Add "scoped" attribute to limit CSS to this component only --> | ||
<style scoped> | ||
h3 { | ||
margin: 40px 0 0; | ||
} | ||
ul { | ||
list-style-type: none; | ||
padding: 0; | ||
} | ||
li { | ||
display: inline-block; | ||
margin: 0 10px; | ||
} | ||
a { | ||
color: #42b983; | ||
} | ||
</style> |
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,50 @@ | ||
<template> | ||
<div> | ||
<span >test</span> | ||
<div> | ||
<input v-model="item.text" placeholder="task desc"/><button @click="add" >添加任务----来自调试的模块</button> | ||
</div> | ||
<div> | ||
<ul> | ||
<li v-for="todo in todos" :key="todo.id"> | ||
{{ todo.text }} | ||
{{ todo.done ? 'done' : 'undergoing' }} | ||
<button v-if="!todo.done" @click="done(todo.id)">完成</button> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</template> | ||
<script> | ||
import { mapState } from 'vuex' | ||
export default { | ||
data() { | ||
return { | ||
item: { | ||
text: '', | ||
done: false | ||
} | ||
} | ||
}, | ||
computed: mapState([ | ||
// 映射 this.count 为 store.state.count | ||
'todos' | ||
]), | ||
methods: { | ||
add() { | ||
this.$store.dispatch('add', this.item) | ||
this.item = { text: '', done: false } | ||
}, | ||
done(id) { | ||
this.$store.dispatch('done', id) | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
li { | ||
list-style-type: none; | ||
} | ||
</style> |
Oops, something went wrong.