提交 e4afdc8e 编写于 作者: ping zhang's avatar ping zhang

new project

上级 e050f892
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*
*.zip
{
"generator-rollup-package": {
"promptValues": {
"author": "souse"
}
}
}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2018-present PICA
\ No newline at end of file
###### 使用说明
> 由于H5 登录成功后调用后台接口判断是否签署协议,如果签署了就不再弹出协议签署框,如果没有则弹出协议弹窗,同意协议则跳转相应页面,不同意则返回上个页面
###### 1. 使用
```javascript
import PicaH5Agreement from 'pica-h5-agreement';
// if for global use
Vue.use(PicaH5Agreement);
```
```html
// template
<pica-h5-login
:close="true"
:base-url="baseUrl"
@login-call="loginCall"
@close-call="closeCall"
/>
// template need popup
<van-popup v-model="show">
<pica-h5-login
:close="true"
:base-url="baseUrl"
@login-call="loginCall"
@close-call="closeCall"
/>
</van-popup>
```
```javascript
// 代码
export default {
data() {
return {
show: false
}
},
methods: {
loginCall(token) {
// 登录成功回调返回值就是token
this.closeCall();
},
closeCall() {
this.show = false;
}
}
}
```
```javascript
vue.config.js 新增配置
transpileDependencies: ['pica-h5-login']
```
###### 2. options
| 参数 | 说明 | 类型 | 默认值 |
| --------- | ---------------------- | -------- | -------- |
| baseUrl | 登录域名 | string | 空 |
| close | 是否显示 close 符号 | boolean | false |
| loginCall | 登录成功回调函数 | function | (token) => {} |
| closeCall | 关闭登录窗口的回调函数 | function | () => {} |
> baseUrl:
> dev : http://dev-sc.yunqueyi.com
> test1: http://test1-sc.yunqueyi.com
> uat: http://uat-sc.yunqueyi.com
package Features
```
\ No newline at end of file
import PicaH5Agreement from './src/agreement.vue';
import PicaH5Agreement from './src/index.vue';
PicaH5Agreement.install = function(Vue) {
Vue.component(PicaH5Agreement.name, PicaH5Agreement);
};
}
export default PicaH5Agreement;
\ No newline at end of file
'use strict';
//
//
//
//
//
//
var script = {
name: 'PicaH5Agreement'
};
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
/* server only */
, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
if (typeof shadowMode !== 'boolean') {
createInjectorSSR = createInjector;
createInjector = shadowMode;
shadowMode = false;
} // Vue.extend constructor export interop.
const options = typeof script === 'function' ? script.options : script; // render functions
if (template && template.render) {
options.render = template.render;
options.staticRenderFns = template.staticRenderFns;
options._compiled = true; // functional template
if (isFunctionalTemplate) {
options.functional = true;
}
} // scopedId
if (scopeId) {
options._scopeId = scopeId;
}
let hook;
if (moduleIdentifier) {
// server build
hook = function (context) {
// 2.3 injection
context = context || // cached call
this.$vnode && this.$vnode.ssrContext || // stateful
this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
// 2.2 with runInNewContext: true
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
context = __VUE_SSR_CONTEXT__;
} // inject component styles
if (style) {
style.call(this, createInjectorSSR(context));
} // register component module identifier for async chunk inference
if (context && context._registeredComponents) {
context._registeredComponents.add(moduleIdentifier);
}
}; // used by ssr in case component is cached and beforeCreate
// never gets called
options._ssrRegister = hook;
} else if (style) {
hook = shadowMode ? function (context) {
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
} : function (context) {
style.call(this, createInjector(context));
};
}
if (hook) {
if (options.functional) {
// register for functional component in vue file
const originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
return originalRender(h, context);
};
} else {
// inject component registration as beforeCreate hook
const existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
return script;
}
const isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
/* script */
const __vue_script__ = script;
/* template */
var __vue_render__ = function () {
var _vm = this;
var _h = _vm.$createElement;
var _c = _vm._self._c || _h;
return _c("div", [_vm._v("\n title\n")]);
};
var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */
const __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = undefined;
/* module identifier */
const __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
/* style inject shadow dom */
var PicaH5Agreement = normalizeComponent({
render: __vue_render__,
staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
PicaH5Agreement.install = function (Vue) {
Vue.component(PicaH5Agreement.name, PicaH5Agreement);
};
module.exports = PicaH5Agreement;
此差异已折叠。
{
"name": "pica-h5-agreement",
"name": "pica-h5-aggrement",
"version": "1.0.2",
"description": "vue call app component",
"description": "pica-h5-aggrement project component",
"author": "souse",
"private": false,
"main": "lib/index.js",
"files": [
"lib",
"src"
],
"scripts": {
"prod": "rollup -c"
},
"repository": {
"type": "git",
"url": "git@192.168.110.53:com.pica.cloud.foundation.frontend/pica-h5-agreement.git"
"url": ""
},
"keywords": [
"rollup",
......@@ -22,9 +18,7 @@
],
"license": "MIT",
"bugs": {},
"dependencies": {
"rollup-plugin-url": "^3.0.0"
},
"dependencies": {},
"peerDependencies": {
"vue": "^2.5.17"
},
......@@ -38,15 +32,18 @@
"rollup": "^1.0.2",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-image": "^1.0.2",
"rollup-plugin-imagemin": "^0.4.0",
"rollup-plugin-node-resolve": "^5.0.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-terser": "^4.0.1",
"rollup-plugin-url": "^2.2.1",
"rollup-plugin-vue": "^5.0.0",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
},
"engines": {
"node": ">= 6.0.0",
"npm": ">= 3.0.0"
"node": ">= 8.0.0",
"npm": ">= 4.0.0"
}
}
import path from 'path';
// import { terser } from 'rollup-plugin-terser';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import babel from 'rollup-plugin-babel';
import vue from 'rollup-plugin-vue';
import autoprefixer from 'autoprefixer';
import pxtorem from 'postcss-pxtorem';
import postcss from 'rollup-plugin-postcss';
import url from 'postcss-url';
import purl from "rollup-plugin-url"
export default {
input: './index.js',
output: {
file: path.resolve(__dirname, './lib', 'index.js'),
format: 'cjs',
name: 'pica-h5-agreement'
},
external: ['vue'],
plugins: [
// terser()
postcss({
plugins: [
autoprefixer({
browsers: ['Android >= 4.0', 'iOS >= 7']
}),
pxtorem({
rootValue: 37.5,
propList: ['*']
}),
// for image in css inline means to base64
url({
url: 'inline'
})
]
}),
purl({
limit: 10 * 1024,
include: ["**/*.png"], // defaults to .svg, .png, .jpg and .gif files
emitFiles: true
}),
vue({
css: false
}),
babel({
runtimeHelpers: true,
// sourceMap: false,
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.vue']
}),
resolve(),
commonjs()
]
};
\ No newline at end of file
.pica-h5-login-container {
display: fixed;
top: 167px;
left: 15px;
right: 15px;
}
\ No newline at end of file
<template>
<div>
<h1>title</h1>
</div>
<div>
title
</div>
</template>
<script>
export default {
name: 'pica-h5-agreement'
name: 'PicaH5Agreement'
}
</script>
</script>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册