在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删除链接时,它保持不变,但是样式表没有加载