在Nuxt布局中导入css文件以恢复[object Object]

时间:2018-12-09 12:32:01

标签: vue.js webpack nuxt.js css-loader nuxt

在Nuxt项目中,我想向布局添加外部样式表

layouts / default.vue:

void miniMaxSum(vector<int> arr)
{
    std::sort (arr.begin(), arr.end());           //(12 32 45 71)26 80 53 33
    unsigned long long minSum = arr[0] + arr[1] + arr[2] + arr[3];
    unsigned long long maxSum = (unsigned long long) arr[arr.size() - 1] + (unsigned long long) arr[arr.size() - 2] + (unsigned long long) arr[arr.size() - 3];
    cout << arr[arr.size() - 1] << " " << arr[arr.size() - 2] << " " << arr[arr.size() - 3] << " " << arr[arr.size() - 4] << " " << endl;
    cout << minSum << " " << maxSum << endl;
}

我在nuxt.config.js(Webpack扩展)中使用此选项

<template>
  <div>
    <img src="~assets/img/test.jpg" />
       <!--resolvs to: <img src="/_nuxt/assets/img/cv.jpg"> -->
    <nuxt/>
    <link rel="stylesheet" href="~assets/style.css" />
       <!-- resolved to: <link rel="stylesheet" href="[object Object]" />
  </div>
</template>

当我从transformAssetUrls删除链接时,它保持不变,但是样式表没有加载

0 个答案:

没有答案