【问题标题】:Nativescript angular style split the scss file into two platform specific scss files (.android.scss / .ios.scss)Nativescript 角度样式将 scss 文件拆分为两个特定于平台的 scss 文件 (.android.scss / .ios.scss)
【发布时间】:2021-07-15 12:27:03
【问题描述】:

我已经修改了我的组件以将其转换为原生脚本角度平台特定的 SCSS 之一 并且正在工作(按钮的背景在 android 平台/模拟器上为黄色,在 SCSS 文件中指定的 IOS 上为绿色),即使它给了我错误:“Error: HostResourceResolver: could not resolve ./auth. component.scss in context of”请看下面(见附图)放入auth.component.ts

我尝试过这样的事情:

@Component({
   selector: 'ns-auth',
   templateUrl: './auth.component.html',
    styleUrls: ['./auth.component.ios.scss', './auth.component.android.scss'],
   moduleId: module.id,
  })

但不工作。它只考虑最后一个(在本例中为 android),忽略第一个 (ios)。

有什么办法可以解决这个问题吗?

【问题讨论】:

    标签: angular sass styles nativescript


    【解决方案1】:

    解决方案很简单但并不明显(寻找文档)。 我创建了一个空的 auth.component.scss 将用于公共属性。

    现在结构如下图所示:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-09
      • 2016-11-01
      • 2017-12-18
      • 2019-08-23
      • 2020-08-20
      • 1970-01-01
      • 2021-09-08
      • 2019-12-15
      相关资源
      最近更新 更多