小编Krz*_*dyl的帖子

如何在样式组件中注册多个字体粗细?

您好,我想使用不同字体粗细的 Inter 字体(400、500、700)。现在它只加载国米常规。我正在使用带有打字稿和样式组件的 create-react-app。

全局样式:

export const GlobalStyle = createGlobalStyle`
  @font-face {
     font-family: 'Inter';
     src: url(${Inter}) format("truetype"),
     url(${InterWoff}) format("woff"),
     url(${InterWoff2}) format("woff2");
     font-weight: normal;
     font-style: normal;
  };
  @font-face {
    font-family: 'Inter';
    src: url(${InterMedium}) format('truetype')
    url(${InterMediumWoff}) format('woff'),
    url(${InterMediumWoff2}) format('woff2');
    font-weight: 500;
    font-style: normal;
  };
  @font-face {
    font-family: 'Inter';
    src: url(${InterBold}) format('truetype')
    url(${InterBoldWoff}) format('woff'),
    url(${InterBoldWoff2}) format('woff2');
    font-weight: bold;
    font-style: normal;
  }
  body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
    'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs create-react-app styled-components

6
推荐指数
1
解决办法
653
查看次数

Ionic 3 如何在点击事件上选择特定的离子芯片?

我有一堆由 ngFor 循环生成的离子芯片。我添加了使用变量选择所有离子芯片的功能tagDefaultColor。现在,当我想选择单个离子芯片时,它会选择所有离子芯片。

我想要实现的是能够使用切换所有按钮来选择每个按钮ion-chip或通过单击事件一一选择它们。一旦ion-chip被选择,它就会将其颜色更改为主要颜色。先感谢您。

constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.information = navParams.data.data;
    this.children = [{ id: 1, name: 'Ginny Weasley' }, { id: 2, name: 'Harry Potter' }, { id: 3, name: 'Ronald Weasley' }, { id: 4, name: 'Luna Lovegood' }];
    this.selectButtonText = 'SELECT ALL';
    //this.tagSelectedColor = "primary";
    this.tagDefaultColor = "secondary";
    this.quantity = 0.0;
    this.shareWithFamily = true;
  }
Run Code Online (Sandbox Code Playgroud)
selectAll() {
    if (this.selectButtonText === 'SELECT ALL') {
      this.selectButtonText = 'UNSELECT ALL'
      this.tagDefaultColor …
Run Code Online (Sandbox Code Playgroud)

ionic3 angular

5
推荐指数
1
解决办法
3487
查看次数

如何从gitlab恢复已删除的远程分支

你好,在将develop分支合并到stage分支时,我忘记了在 Gitlab 上我remove source branch检查了选项。所以现在我有本地过时的develop分支,以及在合并(和删除)develop到stage. 我该怎么做才能完全恢复已删除的版本develop?

git gitlab

5
推荐指数
1
解决办法
5026
查看次数

Vue 测试实用程序如何使用 v-model 更改选择值

您好,我想检查更改测试内部 select 的值后会发生什么。我正在使用vue-test-utils. 目前我无法检查选择是否发出了输入事件。如果重要的话,我正在使用 Buefy select 组件。

组件的html部分

<b-select
  v-model="workHoursType"
>
  <option :value="WORKING_HOURS_PERIOD.daily">{{daily}}</option>
  <option :value="WORKING_HOURS_PERIOD.weekly">{{weekly}}</option>
</b-select>
Run Code Online (Sandbox Code Playgroud)

测试由于undefined发出而失败

it("once working hours type is set to daily, the hours per week should have no value", async () => {
    const wrapper = createWrapper();

    const options = wrapper.find("select").findAll("option");
    await options.at(1).setSelected();

    await flushPromises();

    expect(wrapper.emitted().input).toBeDefined();
  });
Run Code Online (Sandbox Code Playgroud)

我还看到了v-model基于组件的不同方法,但它仍然对我不起作用。

it("with v-model", async () => {
    const wrapper = createWrapper();

    const select = wrapper.find("select");
    const option = wrapper.findAll("option").at(0);
    option.element.selected = true;
    select.trigger("change"); …
Run Code Online (Sandbox Code Playgroud)

javascript testing unit-testing vue.js vue-test-utils

5
推荐指数
0
解决办法
3687
查看次数

在create-react-app上运行构建后的空白页

尝试在netlify上部署create-react-app,但是我的构建是空白页。我正在使用.env文件加载firebase api密钥,这是构建问题吗?

即使当我尝试在其计算机上的空白页上本地打开它并在控制台中输出错误:“使用源“ file:///event-app/static/js/main.108757a0.js加载失败””

package.json:https : //gist.github.com/Verthon/f82371ad2bb636b2e95c5b7697aa0bb5

?  event-app git:(master) ? npm run build

> event-app@0.1.0 build /home/jurr/Projects/event-app
> node scripts/build.js

Creating an optimized production build...
Compiled with warnings.

./src/components/Router.js
  Line 12:  'withFirebase' is defined but never used  no-unused-vars

./src/components/Firebase.js
  Line 21:  'Firebase' is defined but never used  no-unused-vars

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

File sizes after gzip:

  282.86 KB  build/static/js/main.108757a0.js
  3.1 KB     build/static/css/main.8e671453.css

Run Code Online (Sandbox Code Playgroud)

reactjs netlify create-react-app

2
推荐指数
5
解决办法
3728
查看次数