Comments (8)
没明白,能具体点吗?canvasContext 我记得有一个专门的 class 的
from minapp.
我有一个class:
import { CanvasContext } from '@minapp/core'; // 这行代码报错,提示“没有导出的成员 CanvasContext”
class Canvas {
ctx: CanvasContext; // 想使用这个类作为 ctx 的类型,否则用 any 的话没有智能提示
constructor(canvasId: string, instance: any) {
this.ctx = wx.createCanvasContext(canvasId, instance);
}
add(image: Image) {
this.ctx.drawImage(image.url, image.x, image.y, image.width, image.height);
this.ctx.draw();
}
}
from minapp.
哦,这个已经有了,全在 wx 这个命名空间里,比如 wx.CanvasContext
其实,所有的 interface 你都能在 wx 中找到,比如 request 函数参数是 wx.request.Param 类似,总之 request 函数的所有相关 interface 都在 wx.request. 中
from minapp.
其它情况都类似,你自己去体验一下,很容易找到我的命名规律的
wxp 中也类似
from minapp.
谢谢,找了一下没找到 o(╯□╰)o
from minapp.
@fengcen 这个我确定有的,我这几天不方便用电脑。 你可以在这文件里找找 https://github.com/qiu8310/minapp/blob/master/packages/minapp-core/typing/wx.d.ts
from minapp.
找到了,刚才说的是之前没找到,囧
from minapp.
好吧,我理解错了
from minapp.
Related Issues (20)
- 原生开发过程中如何使用wxp? HOT 3
- wx/wxp缺少拓展接口支持 HOT 2
- Interface 'BaseComponent<D, A>' cannot simultaneously extend types 'Component' and 'Options' HOT 1
- 接口“BaseComponent<D, A>”不能同时扩展类型“Component”和“Options”。“Component”和“Options”类型的命名属性“properties”不完全相同
- Promise<any>不存在finally属性 HOT 3
- <feature request> Page增加watch功能
- example 跑不起来 HOT 2
- 通过配置或者约定配置获取自定义组件描述配置 HOT 5
- Featuring minapp in Docusaurus HOT 1
- 初始化项目时,Style Lauguage选择less,会报错 HOT 2
- UglifyJsPlugin 造成WXS报错 HOT 1
- BaseApp获取不到新增page的URL HOT 1
- 可以增加不输入"<"都触发标签名的补全吗?
- 请教一些关于 webpack 问题~ HOT 2
- 引入vant-weapp 或其他外部组件
- 请教一下:导航栏 中文显示乱码的问题 HOT 2
- 已有项目如何安装
- 如何在mina里接入alt数据监控
- 为什么.vsvode/settings.json中的忽略了packages HOT 2
- 本地图片资源的问题 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minapp.