Skip to content

first commit #835

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sites/mip.yjubao.com/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
UTF-8
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{js,styl,html,json,vue}]
indent_size = 2
indent_style = space
[*.md]
trim_trailing_whitespace = false
2 changes: 2 additions & 0 deletions sites/mip.yjubao.com/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
39 changes: 39 additions & 0 deletions sites/mip.yjubao.com/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"parser": "vue-eslint-parser",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module",
"allowImportExportEverywhere": false
},
"extends": [
"standard",
"plugin:vue/recommended"
],
"plugins": [
"jsdoc"
],
"globals": {
"MIP": true
},
"env": {
"browser": true
},
"rules": {
"jsdoc/check-param-names": 1,
"jsdoc/check-tag-names": 1,
"jsdoc/check-types": 1,
"jsdoc/newline-after-description": 1,
"jsdoc/no-undefined-types": 1,
"jsdoc/require-description-complete-sentence": 0,
"jsdoc/require-example": 0,
"jsdoc/require-hyphen-before-param-description": 0,
"jsdoc/require-param": 1,
"jsdoc/require-param-description": 1,
"jsdoc/require-param-name": 1,
"jsdoc/require-param-type": 1,
"jsdoc/require-returns-description": 1,
"jsdoc/require-returns-type": 1,
"jsdoc/valid-types": 1,
"no-var": 2
}
}
8 changes: 8 additions & 0 deletions sites/mip.yjubao.com/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
dist/
.idea/
*.log
Thumbs.db
.DS_Store
*.swp
*.gz
Empty file.
23 changes: 23 additions & 0 deletions sites/mip.yjubao.com/components/mip-test/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html mip>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=no">
<title>MIP page</title>
<link rel="canonical" href="http://net150.top/index.html">
<link rel="stylesheet" href="https://c.mipcdn.com/static/v2/mip.css">
<style mip-custom>
/* 自定义样式 */
</style>
</head>
<body>
<div>

<button on="tap:example.say(你好测试点击按钮)">点我</button>
<mip-test id="example" name="lilei">1111</mip-test>

</div>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-test/mip-test.js"></script>
</body>
</html>
6 changes: 6 additions & 0 deletions sites/mip.yjubao.com/components/mip-test/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
mip-test {
.wrapper {
margin: 0 auto;
text-align: center;
}
}
17 changes: 17 additions & 0 deletions sites/mip.yjubao.com/components/mip-test/mip-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import './index.less'
export default class MIPTest extends MIP.CustomElement {
build () {
let name = this.element.getAttribute('name')
let content = document.createElement('p')
content.innerText = 'Hello ' + name
this.element.appendChild(content)
content.onclick=function(){
console.log(12222);
content.innerText = 11221;
}
// 在这里注册 say 事件的监听
this.addEventAction('say', (event, str) => {
this.element.innerText = str;
})
}
}
26 changes: 26 additions & 0 deletions sites/mip.yjubao.com/example/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html mip>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=no">
<title>MIP page</title>
<link rel="canonical" href="对应的原页面地址">
<link rel="stylesheet" href="https://c.mipcdn.com/static/v2/mip.css">
<style mip-custom>
/* 自定义样式 */
h2 {
margin: 50px auto;
text-align: center;
}
</style>
</head>
<body>
<div>
<h2>First MIP page</h2>
<h2>Add MIP components here</h2>
<mip-example></mip-example>
</div>
<script src="https://c.mipcdn.com/static/v2/mip.js"></script>
<script src="/mip-example/mip-example.js"></script>
</body>
</html>
31 changes: 31 additions & 0 deletions sites/mip.yjubao.com/mip.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @file mip页面项目配置项
* @author
*/

module.exports = {
dev: {
/**
* 启动mip server调试的端口号
*
* @type {number}
*/
port: 8111,

/**
* 启用调试页面自动刷新
*
* @type {boolean}
*/
livereload: true,

/**
* server 启动自动打开页面,false 为关闭
* 如:
* autoopen: '/example/index.html'
*
* @type {string|boolean}
*/
autoopen: false
}
}
25 changes: 25 additions & 0 deletions sites/mip.yjubao.com/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "mip.yjubao.com",
"version": "0.0.1",
"description": "网站js需求",
"scripts": {
"dev": "mip2 dev",
"build": "mip2 build",
"lint": "npm run lint:js",
"lint:js": "eslint --ext .vue,.js .",
"fix": "npm run fix:js",
"fix:js": "eslint --ext .vue,.js . --fix"
},
"author": "lookupone ([email protected])",
"dependencies": {},
"devDependencies": {
"eslint": "^4.19.1",
"eslint-config-standard": "^11.0.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-jsdoc": "^3.7.1",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.8.0",
"eslint-plugin-standard": "^3.1.0",
"eslint-plugin-vue": "^4.5.0"
}
}
Empty file.