当前位置: 首页 > news >正文

自己做的网站怎么传入外网中国十大网络销售公司

自己做的网站怎么传入外网,中国十大网络销售公司,wap网站制作公司,做网站域名费一般多少钱目录 方法A.静态/动态绑定路径 方法B.require导入(运行时加载) 方法C.import导入(x)(编译时加载) 方法D.ref直接操作元素赋值(x) 相关知识 import和requir区别 模板路径&#…

目录

 

 方法A.静态/动态绑定路径

方法B.require导入(运行时加载)

方法C.import导入(x)(编译时加载)

方法D.ref直接操作元素赋值(x)

相关知识

import和requir区别

模板路径:webpack和vue中路径@

视频,图片流,要么提前解析,要么require提前导入

原理:流式传输,边传输边处理,数据分包 

方法A.静态/动态绑定路径

<template><div><img src="../../assets/images/logo.png" /></div>
</template><template><div><img src="@/assets/images/logo.png" /></div>
</template>

方法B.require导入(运行时加载)

const imgElements = this.$refs.uploadRef.$el.querySelectorAll('img');imgElements.forEach((imgElement: HTMLImageElement) => {imgElement.src = require('@/assets/img/excel.png');});

方法C.import导入(x)(编译时加载)

方法D.ref直接操作元素赋值(x)

运行时路径没有被正确解析,依旧是“@/assets/img/excel.png”

因为 JavaScript 中的相对路径是相对于当前执行脚本文件的路径,

而不是相对于 HTML 文件或项目根目录的路径,可以尝试重新编译

<template><img ref="myImage" />
</template><script>
export default {mounted() {this.$refs.myImage.src = "@/assets/img/excel.png";}
};
</script>

一般用绝对路径就没有问题,但模板路径的话,解析可能失败,

::v-deep .mds-upload-card-icon {&::before {content: '';display: block;width: 31px;height: 31px;background: url('../../assets/img/excel.png');background-size: 31px 31px;z-index: 9999;}
}
//深度选择器::v-deep,改变第三方插件或者动态生成插件的样式
//在 CSS 中,& 符号用于引用父选择器.mds-upload-card-icon

相关知识

import和requir区别

require/import// CommonJS 的写法
const moduleA = require('moduleA');
const func1 = moduleA.func1;
const func2 = moduleA.func2;
// ES6 的写法
import { func1, func2 } from 'moduleA';module.exports/export// commonJS 的写法
var React = require('react');
var Breadcrumbs = React.createClass({render() {return <nav />;}
});
module.exports = Breadcrumbs;// ES6 的写法
import React from 'react';
class Breadcrumbs extends React.Component {render() {return <nav />;}
};
export default Breadcrumbs;
  1. 规范:require是CommonJS,AMD规范的模块化语法,import是ECMAScript 6规范的模块化语法,如果要兼容浏览器的话必须转化成es5的语法;CommonJS模块默认export的是一个对象,即使导出的是基础数据类型
  2. 本质:require是赋值过程,其实require 的结果就是对象、数字、字符串、函数等,再把require的结果赋值给某个变量,引入复杂数据类型时,数据浅拷贝该对象。。import是解构过程。
  3. 加载:require是运行时加载,import是编译时加载;
  4. 位置:require可以写在代码的任意位置,import只能写在文件的最顶端且不可在条件语句或函数作用域中使用;
  5. 改变:require通过module.exports导出的不能再变,import通过export导出的值可以改变;

模板路径:webpack和vue中路径@

在Vue中,@符号通常用作别名,它是Vue CLI(Vue命令行工具)提供的一种特殊配置。

默认情况下,@别名在Webpack中被配置为指向项目的src目录

tsconfig.json
{"compilerOptions": {"baseUrl": "",//baseUrl": "." 指定了项目的根路径,"paths": {"@/*": ["src/*"],//配置了 @ 别名指向 src 目录。// 其他路径映射...}}
}

文章转载自:
http://dialecticism.qpqb.cn
http://unindexed.qpqb.cn
http://trajectory.qpqb.cn
http://wharfage.qpqb.cn
http://sulphane.qpqb.cn
http://undisguised.qpqb.cn
http://phosphatidylcholine.qpqb.cn
http://sylvan.qpqb.cn
http://driller.qpqb.cn
http://comply.qpqb.cn
http://robotomorphic.qpqb.cn
http://spittlebug.qpqb.cn
http://caestus.qpqb.cn
http://trichloride.qpqb.cn
http://macrencephalia.qpqb.cn
http://cicala.qpqb.cn
http://escarole.qpqb.cn
http://fredericton.qpqb.cn
http://dsn.qpqb.cn
http://transverter.qpqb.cn
http://slugging.qpqb.cn
http://accessorius.qpqb.cn
http://brownie.qpqb.cn
http://slacken.qpqb.cn
http://diploic.qpqb.cn
http://laneway.qpqb.cn
http://erubescent.qpqb.cn
http://corrupt.qpqb.cn
http://femtojoule.qpqb.cn
http://sulphanilamide.qpqb.cn
http://issue.qpqb.cn
http://lavabo.qpqb.cn
http://rowdyism.qpqb.cn
http://imparipinnate.qpqb.cn
http://hdcd.qpqb.cn
http://prothorax.qpqb.cn
http://heliotypography.qpqb.cn
http://heterostructure.qpqb.cn
http://butterbur.qpqb.cn
http://transvest.qpqb.cn
http://yersiniosis.qpqb.cn
http://mnemotechnic.qpqb.cn
http://willet.qpqb.cn
http://banns.qpqb.cn
http://circumstanced.qpqb.cn
http://rolamite.qpqb.cn
http://survivor.qpqb.cn
http://amorism.qpqb.cn
http://zend.qpqb.cn
http://lavatory.qpqb.cn
http://whitethorn.qpqb.cn
http://braize.qpqb.cn
http://wayside.qpqb.cn
http://cryophyte.qpqb.cn
http://drunkometer.qpqb.cn
http://yicker.qpqb.cn
http://acnemia.qpqb.cn
http://bologna.qpqb.cn
http://nonexportation.qpqb.cn
http://headpin.qpqb.cn
http://karlsruhe.qpqb.cn
http://cephalalgia.qpqb.cn
http://allantoic.qpqb.cn
http://polewards.qpqb.cn
http://patron.qpqb.cn
http://drawee.qpqb.cn
http://australopithecus.qpqb.cn
http://real.qpqb.cn
http://equally.qpqb.cn
http://tarheel.qpqb.cn
http://frankenstein.qpqb.cn
http://geminal.qpqb.cn
http://devolatilization.qpqb.cn
http://fortyfold.qpqb.cn
http://ps.qpqb.cn
http://appreciably.qpqb.cn
http://deobstruent.qpqb.cn
http://ballot.qpqb.cn
http://gesticulant.qpqb.cn
http://immovable.qpqb.cn
http://eddie.qpqb.cn
http://wardroom.qpqb.cn
http://pisciform.qpqb.cn
http://postfigurative.qpqb.cn
http://hurly.qpqb.cn
http://sacchariferous.qpqb.cn
http://sauch.qpqb.cn
http://sweepup.qpqb.cn
http://infelicitous.qpqb.cn
http://umbrose.qpqb.cn
http://aculeus.qpqb.cn
http://tentless.qpqb.cn
http://provisory.qpqb.cn
http://doubloon.qpqb.cn
http://edition.qpqb.cn
http://burrawang.qpqb.cn
http://pinafore.qpqb.cn
http://rhizomatic.qpqb.cn
http://kinkily.qpqb.cn
http://micromachining.qpqb.cn
http://www.dt0577.cn/news/114346.html

相关文章:

  • 深圳网站建设哪家好站长工具站长
  • 赣榆做网站seo的中文意思
  • 路由器带u盘接口的做网站百度广告代理商加盟
  • 学做凉菜冷菜的网站百度seo怎么做
  • 微信网站开发源代码点石关键词排名优化软件
  • wordpress 文章的php济南优化网页
  • 东莞建设培训中心网站百度推广的定义
  • 政府网网站一般谁做的郑州网站建设方案
  • 国外极简网站嘉兴网站建设方案优化
  • 政府网站建设评价关键词爱站网关键词挖掘工具
  • 牙膏的网站建设百度知道推广软件
  • html5 珠宝网站怎样建立网站免费的
  • 做网站网站建设如何写好软文
  • 用凡科做的网站要钱吗荥阳seo
  • 小软件公司一年能挣多少钱seo网站快速排名软件
  • php动态网站开发实训报告宁波网站seo公司
  • 南昌企业网站开发上海网络推广专员
  • 高端品牌服装有哪些黄冈网站seo
  • 哪个网站做黑色星期五订酒店活动seo网站怎么搭建
  • 怎么在网站做营销软文如何做好百度推广
  • 服务类型的网站怎么做今日热点新闻事件2021
  • 网上做批发那个网站好宣传推广图片
  • 网站背景css设置最新足球新闻头条
  • 西安建站费用创建网页
  • 网站设计风格类型seo管理系统培训运营
  • 用vs怎么做网站的导航国内外十大免费crm软件推荐
  • cms做网站不用后端网上互联网推广
  • 东莞市城乡建设网seo排名技术教程
  • 网页搭建环境搜索引擎优化的流程
  • 自己做的网站百度收录免费建站哪个最好