didi / mpx Goto Github PK
View Code? Open in Web Editor NEWMpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架
Home Page: https://mpxjs.cn
License: Apache License 2.0
Mpx,一款具有优秀开发体验和深度性能优化的增强型跨端小程序框架
Home Page: https://mpxjs.cn
License: Apache License 2.0
比如说 vant-weapp
我vant-weapp安装后 要把dist拿出来用?
还是有更方便的方法 直接引入?
用cli生成的项目在运行时报错
VM650:2 未找到 plugin.json 中的定义的 publicComponents "components/list491edbce/list" 对应的 JSON 文件
稍微追了一下,webpack-plugin/lib/json-compiler 文件25行
const rootName = this._compilation._preparedEntrypoints[0].name
来判断是否为app文件并不准确,导致在113行上判断
if (resourcePath === rootName)
时rootName与resourcePath相等了,同为组件名,从而未生成组件的json文件。
具体是哪次做了shift操作?还是组件进入队列的优先级变高了没往下追
是只有我才有的问题吗?
project.config.json 中支持 miniprogramRoot 配置,直接指向 dist 目录就好了,就不用每次从static目录cp到dist里了,在微信开发者工具中又更改的话还可以保留配置
扩展指令 wx:model 会影响 bindinput 事件
@mpxjs/core: 1.0.20
在 app.mpx
<script type="application/json"> { "pages": [ "pages/index/index" ], "window": { }, "usingComponents": { } } </script>引入全局组件支持
MacBook:~ zhanqi$ npm i -g @mpxjs/cli
npm ERR! Unexpected end of JSON input while parsing near '..."^1.0.0","xo":"*"},"d'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhanqi/.npm/_logs/2019-04-17T03_06_58_812Z-debug.log
webpack不是4.0以上吗?
WebpackOptionsValidationError: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
调用微信wx.makePhoneCal()接口会重新触发onShow() 并且会改变store里的值
有没有办法区分测试环境和线上环境还有开发环境
配置如下:
{
test: /\.scss$/,
use: [
{loader: 'css-loader', options: {sourceMap: true}},
{loader: 'sass-loader', options: {sourceMap: true}},
{
loader: 'sass-resources-loader',
options: {
sourceMap: true,
resources: [
resolve('src/styles/mixins.scss')
]
}
}
]
}
在.mpx文件中和.scss文件中均无法找到mixins.scss文件中定义的function
求问这个是哪里配置错误了么?
现在主要是针对的微信小程序,一些文档上是的东西也是只在微信小程序上能用,希望文档明确区分。
另外,创建ali小程序包有问题。
help me
群内人数超过100人,只能通过群内邀请进入。
建议再放一个管理员的二维码,方便加好友邀请进群。
wx:for 时,改变item中的属性不会生效
wx:class="{{ {'cur-label': curIndex === 2} }}"
建议在px转换rpx时在已有的基础上将数值*2。
以iPhone6的375px为标准尺寸的宽的话,在转换成以750为宽的自适应单位rpx时,若数值不变直接转换单位,显示出的尺寸会很小。
如题,在mpx中使用scroll-view时,设置scrollTop=0无法使滚动条回到顶部,但在原生小程序下可以,mpx代码如下图,请问此问题是mpx bug还是用法不对?谢谢
可运行的测试Demo地址:https://github.com/zhdwwf/mpx-scrolltop-test 其中microdemo为原生小程序项目,scrolltopdemo为mpx项目
滴滴全员会宣布过冬:将裁员15%涉及员工超2000人
这个项目还会继续吗
ext.json和project.config.json能打包进dist吗
虽然 ext.json需要生成小程序包的时候手动写入,但是在测试的时候每次npm run watch 都需要把文件复制进去 比较麻烦。
主要是一些老项目,项目已经有一定的基础,无法短时间对项目进行重构,希望可以揉和在一起,逐步替换
组件名称hash后小程序中开发关联组件好像找不到正确路径
getMenuButtonBoundingClientRect,这个api真机调试会让微信崩溃的问题
model不支持trim
如题,现在支持autoprefix插件吗
npm安装第三方组件项目,引用时候无法识别部分es6扩展运算符语法,
以wux-weapp为例:
在index.mpx中引入
{ "navigationBarTitleText": "首页, "usingComponents": { "wux-filterbar": "../components/dist/filterbar" } }
在webpack.base.config.js中配置babel,在谷歌搜的解决办法
{ test: /\.js$/, loader: 'babel-loader', include: [ resolve('src'), resolve('test'), resolve('node_modules/@mpxjs'), resolve('node_modules/wux-weapp') ], options: { presets: ['env', 'es2015', 'react', 'stage-3'] } }
编译提示
./src/components/dist/checkbox-group/index.js (./node_modules/babel-loader/lib!./src/components/dist/checkbox-group/index.js)
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: E:/vueTest/5/demo-test/src/components/dist/checkbox-group/index.js: Unexpected token (46:42)
44 | },
45 | emitEvent(item) {
46 | this.triggerEvent('change', { ...item, name: this.data.name })
| ^
47 | },
48 | },
49 | })
@ ./src/components/dist/checkbox-group/index.js (./node_modules/@mpxjs/webpack-plugin/lib/native-loader.js!./src/components/dist/checkbox-group/index.js) 5:0-41 5:0-41
拷到src下面引入使用,正常编译无报错
{
"usingComponents": {
"list": "../components/list",
"xx-button": "../../node_modules/xx-weapp/button/index"
}
}
如此引入非常不方便
分包问题已修复,点此查看
此问题目前官方已经修复,请升级依赖到最新版本即可!!!
在template里面引入
<wxs src="./../tools.wxs" module="tools" />
会报以下错误:
./../tools.wxs not found from ./pages/index/index.wxml
rt,类似这样
<import src="./towxml/entry.wxml"/>
<template is="entry" data="{{...article}}"/>
模版
<view
class="msg-time"
wx:if="{{index === 0 || !utils.isSameMinute(item.msgTime, list[index - 1].msgTime)}}"
>
</view>
报如下错误
Expressions in wx:if/wx:elif/wx:for can not contain wxs module data.
希望能对 promisify 有所启发 http://github.com/youngjuning/wxPromise
可以让项目源码里少个目录
我使用的是vant-weapp组件
<van-field
id="phone"
wx:model="{{ form.phone }}"
label="手机号"
placeholder="请输入手机号"
error-message="手机号格式错误"
border="{{ false }}"
/>
测试了一下,双向绑定不起作用,是我那里用得不对吗?
请提供多语言方案,比如同时支持中文简体、香港繁体和**繁体
building...{ Error: ENOTEMPTY: directory not empty, rmdir 'D:\Office\project\wxck\dist\pages'
errno: -4051,
code: 'ENOTEMPTY',
syscall: 'rmdir',
path: 'D:\Office\project\wxck\dist\pages' }
| building...
这个问题必现,最新版本的
mpx 版本
"@mpxjs/core": "^1.0.26",
"@mpxjs/fetch": "^1.0.14",
"@mpxjs/promisify": "^1.0.14",
"@mpxjs/url-loader": "^1.0.15",
"@mpxjs/webpack-plugin": "^1.0.26",
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.