Skip to content
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

fix(template): 自定义组件的 xml 后缀应该根据当前平台指定 #7414

Merged
merged 2 commits into from
Aug 22, 2020
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
4 changes: 2 additions & 2 deletions packages/shared/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ export class BaseTemplate {
return template
}

public buildBaseComponentTemplate = () => {
return `<import src="./base.wxml" />
public buildBaseComponentTemplate = (ext: string) => {
return `<import src="./base${ext}" />
<template is="tmpl_0_container" data="{{${this.dataKeymap('i: i')}}}" />`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ require(\\"./taro\\");
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\"}}

/** filePath: dist/comp.jxml **/
<import src=\\"./base.wxml\\" />
<import src=\\"./base.jxml\\" />
<template is=\\"tmpl_0_container\\" data=\\"{{i: i}}\\" />

/** filePath: dist/pages/index/index.js **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2753,7 +2753,7 @@ require(\\"./taro\\");
{\\"component\\":true,\\"usingComponents\\":{\\"comp\\":\\"./comp\\"}}

/** filePath: dist/comp.qml **/
<import src=\\"./base.wxml\\" />
<import src=\\"./base.qml\\" />
<template is=\\"tmpl_0_container\\" data=\\"{{i: i}}\\" />

/** filePath: dist/pages/index/index.js **/
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-mini-runner/src/plugins/MiniPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export default class TaroMiniPlugin {
this.generateTemplateFile(compilation, baseTemplateName, template.buildTemplate, componentConfig)
if (!template.isSupportRecursive) {
// 如微信、QQ 不支持递归模版的小程序,需要使用自定义组件协助递归
this.generateTemplateFile(compilation, baseCompName, template.buildBaseComponentTemplate)
this.generateTemplateFile(compilation, baseCompName, template.buildBaseComponentTemplate, this.options.fileType.templ)
}
this.generateXSFile(compilation)
this.components.forEach(component => {
Expand Down