lighting-ui
Advanced tools
| /** | ||
| * CopyRight (C) 2017-2022 Alibaba Group Holding Limited. | ||
| * Created by Tw93 on 2017-7-18. | ||
| */ | ||
| const path = require('path'); | ||
| const pkg = require('./package.json'); | ||
| const webpack = require('webpack'); | ||
| const glob = require('glob'); | ||
| const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
| const CleanWebpackPlugin = require('clean-webpack-plugin'); | ||
| const plugins = [ | ||
| new CleanWebpackPlugin(['build'], { | ||
| verbose: true | ||
| }), | ||
| new webpack.DefinePlugin({ | ||
| 'process.env': { | ||
| NODE_ENV: JSON.stringify('production') | ||
| }, | ||
| 'global': '{}' | ||
| }), | ||
| new webpack.BannerPlugin({ | ||
| banner: '// { "framework": "Vue" }\n', | ||
| raw: true | ||
| }), | ||
| new CopyWebpackPlugin([ | ||
| { from: 'example/*/index.html' } | ||
| ]) | ||
| ]; | ||
| const needClean = process.argv.indexOf('--watch') > -1; | ||
| needClean && plugins.shift(); | ||
| console.log('Building..., Please wait a moment.'); | ||
| const getEntry = dir => { | ||
| const foundScripts = glob.sync(`${dir}/*/index.js`, {}); | ||
| // 生成 entry 映射表 | ||
| const ret = {}; | ||
| foundScripts.forEach(function (scriptPath) { | ||
| if (!/\.entry\.js$/.test(scriptPath)) { | ||
| ret[scriptPath.replace(/^(.*)\.js$/, '$1')] = './' + scriptPath; | ||
| } | ||
| }); | ||
| return ret; | ||
| }; | ||
| const example = getEntry('example'); | ||
| const entry = Object.assign({ | ||
| 'index': './index.js' | ||
| }, example); | ||
| const getBaseConfig = () => ({ | ||
| devtool: '#source-map', | ||
| entry, | ||
| context: __dirname, | ||
| output: { | ||
| path: path.join(__dirname, 'build'), | ||
| publicPath: '/', | ||
| filename: '[name].js', | ||
| libraryTarget: 'umd', | ||
| library: `npm/${pkg.name}/[name]`, | ||
| umdNamedDefine: false | ||
| }, | ||
| stats: { | ||
| colors: true, | ||
| modules: false, | ||
| reasons: false | ||
| }, | ||
| module: { | ||
| rules: [{ | ||
| test: /\.js$/, | ||
| use: { | ||
| loader: 'babel-loader', | ||
| options: { | ||
| cacheDirectory: true, | ||
| } | ||
| } | ||
| }, { | ||
| test: /\.vue(\?[^?]+)?$/, | ||
| use: [] | ||
| }] | ||
| }, | ||
| plugins, | ||
| resolve: { | ||
| extensions: ['.js'], | ||
| modules: [ | ||
| 'node_modules' | ||
| ] | ||
| } | ||
| }); | ||
| const webCfg = getBaseConfig(); | ||
| webCfg.output.filename = '[name].web.js'; | ||
| webCfg.module.rules[1].use.push({ | ||
| loader: 'vue-loader', | ||
| options: { | ||
| compilerModules: [ | ||
| { | ||
| postTransformNode: el => { | ||
| el.staticStyle = `$processStyle(${el.staticStyle})` | ||
| el.styleBinding = `$processStyle(${el.styleBinding})` | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| }); | ||
| const nativeCfg = getBaseConfig(); | ||
| nativeCfg.output.filename = '[name].native.js'; | ||
| nativeCfg.module.rules[1].use.push('weex-loader'); | ||
| const exportConfig = [ | ||
| webCfg, | ||
| nativeCfg | ||
| ]; | ||
| module.exports = exportConfig; |
+1
-1
| { | ||
| "name": "lighting-ui", | ||
| "version": "0.3.130", | ||
| "version": "0.3.131", | ||
| "description": "A rich interaction, lightweight, high performance UI library based on Weex", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -152,3 +152,3 @@ <!-- CopyRight (C) 2017-2022 Alibaba Group Holding Limited. --> | ||
| .index-list-title { | ||
| border-bottom-width: 1px; | ||
| border-bottom-width: 2px; | ||
| border-color: rgba(32, 35, 37, 0.15); | ||
@@ -174,3 +174,3 @@ background-color: #FBFBFB; | ||
| align-items: center; | ||
| border-bottom-width: 1px; | ||
| border-bottom-width: 2px; | ||
| border-bottom-color: #e0e0e0; | ||
@@ -177,0 +177,0 @@ height: 92px; |
@@ -69,6 +69,5 @@ <!-- CopyRight (C) 2017-2022 Alibaba Group Holding Limited. --> | ||
| <script> | ||
| import { GIF, BLACK_GIF } from './type'; | ||
| import { BLACK_GIF } from './type'; | ||
| import Utils from '../utils'; | ||
| import Light from 'light'; | ||
| const meta = Light.requireModule('meta'); | ||
@@ -104,4 +103,4 @@ export default { | ||
| src: { | ||
| type: String, | ||
| default: BLACK_GIF | ||
| type: String, | ||
| default: BLACK_GIF | ||
| } | ||
@@ -145,15 +144,18 @@ }, | ||
| }, | ||
| mounted() { | ||
| let devWidth = meta.getViewport().width; | ||
| let deviceWidth = weex.config.env.deviceWidth; | ||
| Light.on("screenWidthChange", (res) => { | ||
| // weex.config.env.deviceWidth在折叠屏不会变,故目前采用这个缩放比计算,可能有其他更好方案 | ||
| this.$nextTick(() => { | ||
| let newWidth = meta.getViewport().width; | ||
| const scale = newWidth / devWidth; | ||
| devWidth = newWidth; | ||
| deviceWidth = deviceWidth * scale; | ||
| this.loadTop = (this.getPageHeight(deviceWidth) - 200) / 2; | ||
| mounted () { | ||
| const meta = Light.requireModule('meta'); | ||
| if (meta && meta.getViewport) { | ||
| let devWidth = meta.getViewport().width; | ||
| let deviceWidth = weex.config.env.deviceWidth; | ||
| Light.on('screenWidthChange', () => { | ||
| // weex.config.env.deviceWidth在折叠屏不会变,故目前采用这个缩放比计算,可能有其他更好方案 | ||
| this.$nextTick(() => { | ||
| const newWidth = meta.getViewport().width; | ||
| const scale = newWidth / devWidth; | ||
| devWidth = newWidth; | ||
| deviceWidth = deviceWidth * scale; | ||
| this.loadTop = (this.getPageHeight(deviceWidth) - 200) / 2; | ||
| }); | ||
| }); | ||
| }); | ||
| } | ||
| }, | ||
@@ -160,0 +162,0 @@ methods: { |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1316994
0.2%333
0.3%1526
7.54%