-
Notifications
You must be signed in to change notification settings - Fork 66
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
Refactor using glass easel #109
base: master
Are you sure you want to change the base?
Conversation
@@ -19,9 +21,19 @@ | |||
``` | |||
|
|||
```js | |||
simulate.load('/comp') // 渲染出来的结果是 <comp><wx-view class="main--abc">123</wx-view></comp> | |||
const comp = simulate.render(simulate.load('/comp')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simulate.loadComponent ?
|
||
## dom 接口模拟 | ||
## 根路径 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档顶上的锚点没有更新
@@ -89,10 +117,12 @@ test('test some', () => { | |||
|
|||
## 内置组件 | |||
|
|||
TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接告知内置组件会渲染成没有任何作用的自定义标签?
|
||
> PS:推荐使用 jest 来搭配此工具集使用,jest 内部已集成 jsdom,通过配置 testEnvironment 字段的值为 jsdom 即可以类浏览器环境的方式来执行测试用例。 | ||
```js | ||
simulate.load('/comp/index', { rootPath: '/comp' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simulate.loadComponent
|
||
it('test', () => { | ||
// 加载自定义组件,自定义组件在当前的 components/comp/index 目录下 | ||
const id = simulate.load( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simulate.loadComponent
|
||
it('should run successfully', () => { | ||
// 加载自定义组件,自定义组件在当前的 components/comp/index 目录下 | ||
const id = simulate.load('/components/comp/index') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simulate.loadComponent
|
||
comp.detach() // 将组件从容器节点中移除,会触发 detached 生命周期 | ||
// 加载自定义组件,自定义组件在当前的 components/comp/index 目录下 | ||
const id = simulate.load( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadComponent
// 前略 | ||
|
||
// 加载自定义组件,自定义组件在当前的 components/comp/index 目录下 | ||
const id = simulate.load( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadComponent
|
||
it('test', () => { | ||
// 加载自定义组件 | ||
const id = simulate.load( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loadComponent
|
||
```js | ||
const simulate = require('miniprogram-simulate') | ||
``` | ||
|
||
## 起步例子 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
下面的例子,可以补充一下 scrollTo 和 dispatchTapEvent 的例子?
@@ -1,287 +1,152 @@ | |||
# 接口 | |||
|
|||
## behavior(definition) | |||
## `loadComponent(componentPath: string): string` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.