Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/taro-runtime/src/bom/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ export function createTTDomDocument(): TaroDocument {
const result = originalSetAttribute(name, value)

// 处理 catchMove 属性
if (name === 'catchMove' && value) {
el.addEventListener('catchtouchmove', emptyFunction)
if (name === 'catchMove') {
if (value) {
el.addEventListener('catchtouchmove', emptyFunction)
} else {
el.removeEventListener('catchtouchmove', emptyFunction)
}
}

return result
Expand Down
10 changes: 10 additions & 0 deletions packages/taro-vite-runner/src/mini/emit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ import type { PluginOption } from 'vite'
export default function (viteCompilerContext: ViteMiniCompilerContext): PluginOption {
return [{
name: 'taro:vite-mini-emit',
renderChunk (code, chunk) {
if (viteCompilerContext && chunk.isEntry && chunk.name === viteCompilerContext.app.name) {
const { app } = viteCompilerContext
const appConfig = app.config
if (process.env.TARO_ENV === 'tt' && appConfig) {
return `if (typeof tt !== 'undefined') {\n tt.__$enableTTDom$__ = ${appConfig.enableTTDom};\n}\n${code}`
}
}
return null
},
async generateBundle (_outputOpts, bundle) {
const isUsingCustomWrapper = componentConfig.thirdPartyComponents.has('custom-wrapper')

Expand Down