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

在obsidian 中使用的异常 #39

Open
zcr268 opened this issue May 14, 2024 · 1 comment
Open

在obsidian 中使用的异常 #39

zcr268 opened this issue May 14, 2024 · 1 comment

Comments

@zcr268
Copy link

zcr268 commented May 14, 2024

image

基于原始的代码实现无法获取到数据更改为这样才能获取到内容.修改为cli 模板生成代码截图如上,代码如下:

const messages = {
    {{each languages}}{{if $value.name == defaultLanguage}}'{{defaultLanguage}}' :  defaultMessages{{if $index !== languages.length - 1}},{{/if}}
    {{else if $value.name == activeLanguage}}{{if defaultLanguage !== activeLanguage}}'{{activeLanguage}}':defaultFormatters{{/if}}{{if $index !== languages.length - 1}},{{/if}}
    {{else}}'{{$value.name}}' : async ()=> (await import("./{{$value.name}}")).default{{if $index !== languages.length - 1}},{{'\n\t'}}{{/if}}{{/if}}{{/each}}
}

const formatters = {
    {{each languages}}{{if $value.name == defaultLanguage}}'{{defaultLanguage}}' :  defaultFormatters{{if $index !== languages.length - 1}},{{/if}}
    {{else if $value.name == activeLanguage}}{{if defaultLanguage !== activeLanguage}}'{{activeLanguage}}':activeMessages{{/if}}{{if $index !== languages.length - 1}},{{/if}}
    {{else}}'{{$value.name}}' : async ()=> (await import("./formatters/{{$value.name}}")).default{{if $index !== languages.length - 1}},{{'\n\t'}}{{/if}}{{/if}}{{/each}}
}
@zhangfisher
Copy link
Owner

这可能跟obsidian使用的构建工具对esm模块的默认导出的处理有关,我考虑一下如何更好的兼容
谢谢您的反馈!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants