vue如何引用static里图片
时间: 2023-07-04 10:20:43 浏览: 75
频后的图
N = length(y3); % 信号长度
hop = round(N/(T*2)); % 跳频周期
jump = round(N/100); % 跳频步进
p = randi([0 1], 1, hop);在Vue项目中,可以通过以下步骤引用static文件夹中的图片:
1. 将图片放入Vue项目的` % 产生跳频序列
p = repmat(p, 1, T*2/hop); % 扩展跳频序static`文件夹中,例如将图片命名为`example.jpg`并放在`static/images`文件夹中。
2.列
p = [p zeros(1, N-length(p))]; % 补零
y4 = y3.*cos(2*pi 在Vue组件中使用`img`标签来显示图片,例如:
```html
<template>
<div>
<*f3*t).*exp(1i*2*pi*jump*p); % 混频
figure;
subplot(2,1,1);
img src="/static/images/example.jpg" alt="Example Image">
</div>
</template>
```
在这个例子中,plot(t, real(y4));
xlabel('时间(s)');
ylabel('幅度');
title('混频后的信号时域波形图');
subplot(2,1,2);
Y4 = fftshift(fft(y4));
plot(f, abs(Y4));
xlabel('`/static`表示Vue项目的根路径,所以`/static/images/example.jpg`表示图片的完整路径。
注意:频率(Hz)');
ylabel('幅度');
title('混频后的信号频域波形图');
%% 6. 经在Vue项目中使用`/static`路径时,需要在`config/index.js`文件中将`assetsPublicPath`设置为过解跳和解调并滤波之后恢复出基带信号并做图
y5 = y4.*exp`/`,例如:
```javascript
module.exports = {
dev: {
assetsPublicPath: '/',
// ...
},
(-1i*2*pi*jump*p); % 解跳
y6 = fskdemod(y5, [f1, f // ...
}
```
这样才能正确地引用static文件夹中的图片。