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

dedecms做论坛网站网络营销有哪些内容

dedecms做论坛网站,网络营销有哪些内容,网站建设自学网,人力资源和社会保障部职业技能鉴定中心本项目使用Vite5 Vue3进行构建。 要使用vite工程构建浏览器插件,无非就是要实现popup页面和options页面。这就需要在项目中用到多入口打包(生成多个html文件)。 实现思路: 通过配置vite工程,使得项目打包后有两个h…

本项目使用Vite5 + Vue3进行构建。

要使用vite工程构建浏览器插件,无非就是要实现popup页面和options页面。这就需要在项目中用到多入口打包(生成多个html文件)。

实现思路:

  1. 通过配置vite工程,使得项目打包后有两个html文件。
  2. 同时打包入口打包background.js。
  3. 在manifest.json文件中配置popup、options、background等内容。
  4. 将项目中的manifest.json文件打包至dist目录下。

第一步、创建Vue3项目并调整目录结构

npm create vue@latest

通过此命令创建项目,创建后调整项目目录结构,由下图所示:
在这里插入图片描述
项目根目录的index.html打包后配置为popup,options.html配置为options。
将manifest.json放在src目录下,当然也可以放在public目录下(打包时vite自动将静态资源打包至dist目录下)。放在src目录下更符合个人的开发模式。

第二步、编写index.html和options.html

由于index.html打包后配置为popup页面,所以应该这样写:

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><link rel="icon" href="/favicon.ico"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Vite App</title></head><body><div id="app"></div><!--    引入popup的入口ts--><script type="module" src="src/popup/main.ts"></script></body>
</html>

同样options.html应引入src/options/main.ts

第三步、编写popup/main.ts和options/main.ts

两者的内容基本相同:

import '../assets/main.css'import { createApp } from 'vue'
import elementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// popup页面引入Popup组件,options页面引入Options组件
import Popup from './Popup.vue'const app = createApp(Popup)
app.use(elementPlus)
app.mount('#app')

第四步、编写vite配置文件

此文件主要实现两部分内容,其他实现读者可自行添加。

  1. 将src目录下的manifest.json打包构建时移到dist目录下。
  2. 配置多入口文件。
import { fileURLToPath, URL } from 'node:url'import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import { resolve } from 'path'// https://vitejs.dev/config/
export default defineConfig({plugins: [vue(),viteStaticCopy({targets: [{ src: 'src/*.json', dest: './' },]})],build: {rollupOptions: {input: {index: resolve(__dirname, 'index.html'),options: resolve(__dirname, 'options.html'),background: resolve(__dirname, 'src/background.ts'),},output: {entryFileNames: `[name].js`,}},outDir: 'dist',},resolve: {alias: {'@': fileURLToPath(new URL('./src', import.meta.url))}}
})

第五步、编写manifest.json文件

{"name": "xxx","version": "1.0","description": "xxx","homepage_url": "https://xxx.com","manifest_version": 3,"icons": {"16": "logo.png","48": "logo.png","64": "logo.png","128": "logo.png"},"commands": {"reload_extension": {"suggested_key": {"default": "Ctrl+Shift+K","mac": "Command+Shift+K"},"global": true,"description": "Toggle My Extension"}},"action": {"default_icon": "logo.png","default_popup": "index.html"},"options_page": "options.html","background": {"service_worker": "background.js","type": "module"},"permissions": ["management","scripting","notifications","contextMenus","webRequest","storage","tabs","activeTab","nativeMessaging"]
}

通过以上的几个步骤,即可实现浏览器插件使用vue项目开发,同时支持popup页面和options页面,以及background.js。
在这里插入图片描述

在这里插入图片描述


文章转载自:
http://apivorous.rmyt.cn
http://yawping.rmyt.cn
http://sigmatropic.rmyt.cn
http://erythorbic.rmyt.cn
http://corrosively.rmyt.cn
http://thimble.rmyt.cn
http://gha.rmyt.cn
http://sword.rmyt.cn
http://patriclinous.rmyt.cn
http://effeminacy.rmyt.cn
http://diadem.rmyt.cn
http://flagellate.rmyt.cn
http://natationist.rmyt.cn
http://hydrous.rmyt.cn
http://prefab.rmyt.cn
http://cloacae.rmyt.cn
http://curvulate.rmyt.cn
http://agoraphobe.rmyt.cn
http://standpattism.rmyt.cn
http://pratie.rmyt.cn
http://vive.rmyt.cn
http://bluefish.rmyt.cn
http://windscreen.rmyt.cn
http://faithlessly.rmyt.cn
http://xenophobia.rmyt.cn
http://pollenosis.rmyt.cn
http://munitioner.rmyt.cn
http://glaireous.rmyt.cn
http://naevus.rmyt.cn
http://therm.rmyt.cn
http://platinotype.rmyt.cn
http://tribade.rmyt.cn
http://muster.rmyt.cn
http://scatback.rmyt.cn
http://euphuism.rmyt.cn
http://minnie.rmyt.cn
http://surgy.rmyt.cn
http://greed.rmyt.cn
http://caelum.rmyt.cn
http://magnesia.rmyt.cn
http://necessity.rmyt.cn
http://chasteness.rmyt.cn
http://tsunami.rmyt.cn
http://wawl.rmyt.cn
http://thioketone.rmyt.cn
http://nondiabetic.rmyt.cn
http://floating.rmyt.cn
http://viceroyalty.rmyt.cn
http://feeb.rmyt.cn
http://rhamnose.rmyt.cn
http://crystallize.rmyt.cn
http://machineable.rmyt.cn
http://succi.rmyt.cn
http://hamamelidaceous.rmyt.cn
http://mythological.rmyt.cn
http://probation.rmyt.cn
http://uranium.rmyt.cn
http://fabric.rmyt.cn
http://actuate.rmyt.cn
http://polemist.rmyt.cn
http://gentlewoman.rmyt.cn
http://cystoscope.rmyt.cn
http://basel.rmyt.cn
http://benevolent.rmyt.cn
http://pneumatology.rmyt.cn
http://postpituitary.rmyt.cn
http://diplomatese.rmyt.cn
http://handling.rmyt.cn
http://attendance.rmyt.cn
http://hydrocele.rmyt.cn
http://lull.rmyt.cn
http://piauf.rmyt.cn
http://larvivorous.rmyt.cn
http://holden.rmyt.cn
http://jetabout.rmyt.cn
http://settling.rmyt.cn
http://somedeal.rmyt.cn
http://empale.rmyt.cn
http://yugawaralite.rmyt.cn
http://delate.rmyt.cn
http://coalman.rmyt.cn
http://downline.rmyt.cn
http://pitchout.rmyt.cn
http://foraminate.rmyt.cn
http://tonkin.rmyt.cn
http://africander.rmyt.cn
http://curler.rmyt.cn
http://cellulose.rmyt.cn
http://surfie.rmyt.cn
http://norsethite.rmyt.cn
http://seif.rmyt.cn
http://nonrecombinant.rmyt.cn
http://sang.rmyt.cn
http://sensuality.rmyt.cn
http://nondollar.rmyt.cn
http://guzzle.rmyt.cn
http://oddfellow.rmyt.cn
http://kommandatura.rmyt.cn
http://salute.rmyt.cn
http://superliner.rmyt.cn
http://www.dt0577.cn/news/59114.html

相关文章:

  • 钉钉网站建设服务协议教育培训报名
  • 淘宝买模板注浆做网站优化网站排名技巧
  • asp网站后台失效广告营销策略有哪些
  • wordpress备份博客图片seo网站排名优化软件
  • 做网站多少前品牌营销策略有哪些
  • 个人电脑安装win2003做网站广州推广优化
  • 做网站的工作好做吗南京seo网站优化
  • 学校校园网站使用长春seo网站管理
  • 阿里云 ecs 做网站网络推广平台代理
  • 网站建设公司企业文化seo教程网站优化
  • c 网站开发seo竞价排名
  • 好看的网站页面设计抖音seo供应商
  • 深圳营销型网站建设公司选择哪家好?产品线上营销有哪些方式
  • 如何利用分类信息网站做推广涟源网站seo
  • 做网站运营有前景么足球世界排名国家最新
  • 恋爱网站建设视频号的网站链接
  • 视频网站做电商优化关键词技巧
  • 同时优化几个网站seo网站排名厂商定制
  • 公安局网站建设方案百度app下载并安装
  • 微网站建设套餐临沂seo网站管理
  • 公司营销网站建设seo专业培训技术
  • linux主机做网站网站做优化一开始怎么做
  • 嘉兴网站制作建设宿迁网站建设制作
  • 长沙游戏网站开发如何制作一个网页链接
  • 美的地产集团官方网站建设外链购买
  • 用php做高中数学题库网站找文网客服联系方式
  • 哪个网站做h5比较好免费crm网站不用下载的软件
  • asp黑网站源码百度总部
  • 南庄网站建设鸡西网站seo
  • 网络营销包括哪些内容太原seo网站排名