- skyline渲染模式下,scoll-view无法使用scoll-into-view属性?
skyline渲染模式下,scoll-view嵌套sticky-section无法使用scoll-into-view属性。提示 [Component] <scroll-view>: setting scroll-into-view to a virtual node is invalid
2023-12-07 - 自定义组件组件中使用canvas-2d不能正常绘制是什么情况?
如题,代码在Page中能正常运行,但是在Component中无法运行 const app = getApp(); const messageComponentBehavior = require("../../behaviors/message-component-behavior"); Component({ behaviors: [ messageComponentBehavior ], /** * 组件的属性列表 */ properties: { }, /** * 组件的初始数据 */ data: { }, /** * 组件的方法列表 */ methods: { createSoundIcon() { const query = this.createSelectorQuery(); const dpr = this.data.dpr; query.select(".sound-icon").fields({ node: true, size: true }).exec(res => { const canvas = res[0].node; const ctx = canvas.getContext("2d"); const w = res[0].width, h = res[0].height; canvas.width = w * dpr; canvas.height = h * dpr; ctx.scale(dpr, dpr); ctx.fillRect(0, 0, 10, 10); ctx.fillStyle = "#000"; }); }, init() { } }, lifetimes: { ready() { this.createSoundIcon(); } } })
2022-06-16