打包h5如何配置域名:
在manifest.json中配置域名
配置完成后无论是测试环境还是正式环境都带上/mobile/,否则会报错404
如何引入调试工具erada:
在默认的index.html中直接引入erada,页面样式会整个错乱,解决方案就是引入官方的index.html模板,再到上面引入外部JS
<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title><%= htmlWebpackPlugin.options.title %></title><!-- Open Graph data --><!-- <meta property="og:title" content="Title Here" /> --><!-- <meta property="og:url" content="http://www.example.com/" /> --><!-- <meta property="og:image" content="http://example.com/image.jpg" /> --><!-- <meta property="og:description" content="Description Here" /> --><script>var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')</script><!-- 引入eruda --><script src="https://cdn.jsdelivr.net/npm/eruda"></script><script>eruda.init();</script><link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" /></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id="app"></div><!-- built files will be auto injected --></body>
</html>
最重要的一步是在manifest.json中配置路径
表单校验出现:提交的字段[‘xx’]在数据库中不存在
解决方案:
不要把v-if直接写在uni-forms-item标签上,可以在这上面包一层view,并将v-if写在view上