网站开发人员的岗位有,wordpress中注册功能,云渲染网站开发,用自己电脑建设网站【腾讯云 Cloud Studio 实战训练营】使用 Cloud Studio 快速构建 Vue Vite 完成律师 H5 页面 前言一、基本介绍1.应用场景2.产品优势 二、准备工作1.注册 Cloud Studio2.进入 Vue 预置开发环境 三、使用 Cloud Studio 快速构建 Vue Vite 完成律师 H5 页面1.安装相关依赖包2.主… 【腾讯云 Cloud Studio 实战训练营】使用 Cloud Studio 快速构建 Vue Vite 完成律师 H5 页面 前言一、基本介绍1.应用场景2.产品优势 二、准备工作1.注册 Cloud Studio2.进入 Vue 预置开发环境 三、使用 Cloud Studio 快速构建 Vue Vite 完成律师 H5 页面1.安装相关依赖包2.主文件引入相关库和包3.首页增加移动端默认样式4.增加主要代码5.验证 四、将代码提交到远程仓库五、开发空间 前言 腾讯云与国内领先的一站式软件研发平台 CODING 联合推出一款完全基于云端的 IDECloud Studio实现 Coding Anytime Anywhere。 Cloud Studio 是基于浏览器的集成式开发环境IDE为开发者提供了一个稳定的云端工作站。
用户在使用 Cloud Studio 时无需安装随时随地打开浏览器就能使用。其功能包含代码高亮、自动补全、Git 集成、终端等 IDE 的基础功能同时支持实时调试、插件扩展等可以帮助开发者快速完成各种应用的开发、编译与部署工作。
一、基本介绍
云端 IDE Cloud Studio 是腾讯云为编程者打造的专属开发利器开发者无需考虑编程本身以外的限制无缝对接部署至腾讯云还有协作、团队管理等功能强势辅助让开发者安心高效编程。官方网站 1.应用场景
快速启动项目 使用 Cloud Studio 的预置环境直接创建出对应类型的工作空间即可进行开发无需进行繁琐的环境配置实时调试网页 Cloud Studio 内置预览插件可以实时显示网页应用当代码发生改变时预览窗口会自动刷新远程访问云服务器 Cloud Studio 支持连接自己的云服务器可以在编辑器中查看云服务器上的文件进行在线编程和部署工作。
2.产品优势
使用场景 Cloud Studio 适用于开发微信小程序、中小型项目、在线修改代码等多种场景无需安装跨平台 基于 Web 端的代码编辑器无论在哪里都可以进行代码编写和编译运行智能的代码提示 Cloud Studio 支持 Java、JS、HTML 和 TypeScript 的代码提示基于当前文件上下文的理解提高开发效率错误提示 Cloud Studio 后台会不间断地对代码进行分析并会在多处显示实时提醒并会给予相应的修改建议。
二、准备工作
1.注册 Cloud Studio
这里注册和登录 Cloud Studio 非常方便提供了三种注册方式
使用 CODING 账号注册使用微信授权注册使用 GitHub 授权注册。 授权注册后即可进入首页空间模板开箱即用可以快速搭建环境进行代码开发同时 Cloud Studio 也对所有新老用户每月赠送 3000 分钟的工作空间免费时长。
2.进入 Vue 预置开发环境
Cloud Studio 控制台中包含了常见的集成开发环境支持 40 的多种模板框架模板、云原生模板、建站模板单击所需模板卡片即可进入对应环境中也可以选择新建工作空间中的云服务器模式连接云服务器进行开发环境搭建。 因为本文实验主旨是利用云 IDE Cloud Studio 快速搭建还原一个移动端 H5 的页面所以这里我们选择使用 Vue 模板来实现功能。点击 Vue.js 模板卡片进入集成环境加载页面加载成功后即可进入开发环境进行编程。 Cloud Studio 帮助我们初始化好开发 Vue 环境并且默认有一个小 Demo系统相关配置信息
服务器配置2C 4G当前目录为/workspace当前 Node 版本为 v16.17.0Npm 版本为 8.18.0。 这里上手非常简单操作界面基本跟我们平时使用的 VS Code 操作界面非常类似可以快速迁移。
三、使用 Cloud Studio 快速构建 Vue Vite 完成律师 H5 页面
1.安装相关依赖包 为了快速开发一般我们会采用一些 UI 库比如移动端我们经常会选择 Vant在 CSS 这块我们也一般会使用 SCSS 和 LESS 这些 CSS 预处理语言本实验中我们选择 Less。 1安装 Vant
yarn add vant^3.6.122按需引入组件样式 在基于 Vite、Webpack 或 Vue-cli 的项目中使用 Vant 时可以使用 unplugin-vue-components 插件它可以自动引入组件并按需引入组件的样式。 yarn add -D unplugin-vue-components^0.22.7-D表示安装到开发依赖中。
3在 vite.config.js 文件中配置插件
import { fileURLToPath, URL } from node:urlimport { defineConfig } from vite
import vue from vitejs/plugin-vue
// 引入以下2个库
import Components from unplugin-vue-components/vite;
import { VantResolver } from unplugin-vue-components/resolvers;// https://vitejs.dev/config/
export default defineConfig({plugins: [vue(),// 增加以下配置Components({// 不生成类型声明文件自己写dts: false,// 样式需要单独引入resolvers: [VantResolver({ importStyle: false })]}),],resolve: {alias: {: fileURLToPath(new URL(./src, import.meta.url))}}
})完成以上安装和修改配置文件两步即可直接在模块中使用 Vant 组件unplugin-vue-components 会解析模板并自动注册对应的组件。
4安装 Less
yarn add -D less^3.12.25在 vite.config.js 文件中增加 Less 配置
import { fileURLToPath, URL } from node:urlimport { defineConfig } from vite
import vue from vitejs/plugin-vueimport Components from unplugin-vue-components/vite;
import { VantResolver } from unplugin-vue-components/resolvers;// https://vitejs.dev/config/
export default defineConfig({plugins: [vue(),// 增加以下配置Components({// 不生成类型声明文件自己写dts: false,// 样式需要单独引入resolvers: [VantResolver({ importStyle: false })]}),],resolve: {alias: {: fileURLToPath(new URL(./src, import.meta.url))}},// 增加以下css配置代码css: {preprocessorOptions: {less: {javascriptEnabled: true,},},},
})6安装 Normalize Normalize 是 CSS 重置的现代替代方案可以为默认的 HTML 元素样式上提供了跨浏览器的高度一致性相比于传统的 CSS ResetNormalize 是一种现代的、为 HTML5 准备的优质替代方案。 yarn add -D normalize.css^8.0.1 2.主文件引入相关库和包
上面我们安装了开发中常用的一些包和库安装完后需要在主文件 main.js 进行引入使用文件位置 src/main.js
import { createApp } from vue
import App from ./App.vue
// 按需引入 Vant
import { Tabbar, TabbarItem } from vant;
import vant/lib/index.css
// CSS 重置的现代替代方案
import normalize.css/normalize.css// 实例化 Vue 实例
const app createApp(App)// 安装 Vant 相关使用插件
app.use(Tabbar);
app.use(TabbarItem);// 挂载到 #app 节点
app.mount(#app)3.首页增加移动端默认样式
在 src/index.html 文件中增加
!DOCTYPE html
html langenheadmeta charsetUTF-8link relicon href/favicon.icometa nameviewport contentwidthdevice-width, initial-scale1.0titleVite App/title/headbodydiv idapp/divscript typemodule src/src/main.js/script!-- built files will be auto injected --script// rem定义/*720代表设计师给的设计稿的宽度你的设计稿是多少就写多少;100代表换算比例*/getRem(375, 100);window.onresize function() {getRem(375, 100);};function getRem(pwidth, prem) {var html document.getElementsByTagName(html)[0];var oWidth document.documentElement.clientWidth || document.body.clientWidth;html.style.fontSize (oWidth / pwidth) * prem px;}// 安卓机中默认字体大小不让用户修改;(function () {if (typeof WeixinJSBridge object typeof WeixinJSBridge.invoke function) {handleFontSize()} else {if (document.addEventListener) {document.addEventListener(WeixinJSBridgeReady, handleFontSize, false)} else if (document.attachEvent) {document.attachEvent(WeixinJSBridgeReady, handleFontSize)document.attachEvent(onWeixinJSBridgeReady, handleFontSize)}}function handleFontSize() {// 设置网页字体为默认大小WeixinJSBridge.invoke(setFontSizeCallback, {fontSize: 0,})// 重写设置网页字体大小的事件WeixinJSBridge.on(menu:setfont, function () {WeixinJSBridge.invoke(setFontSizeCallback, {fontSize: 0,})})}})()/script/body
/html4.增加主要代码
在 src/App.vue 文件中增加主要的业务代码
templatediv classcontainervan-nav-bartitlee租宝案left-arrow/div classlist_boxdiv classlistdiv classlist-head开庭前准备 5/divdiv classlist_itemdiv classlist_item-headvan-checkbox v-modelradio shapesquare核对证据原件并存档/van-checkboxdiv classlist_item-head_namediv classlist_item-head_name-tag/divdiv classlist_item-head_name-texte租宝案/div/div/divdiv classlist_item-infoimg classlist_item-info_img styledisplay: block; srchttps://cs-res.codehub.cn/workspace/assets/icons/emberjs.svg lazy-load alt /div classlist_item-info_tag list_item-info_tag--gray03-28 截止/divimg classlist_item-info_clock styledisplay: block; srchttps://cs-res.codehub.cn/vscode/serverless.svg lazy-load alt //div/divdiv classlist_item list_item--bluediv classlist_item-headvan-checkbox v-modelradio1 shapesquare调取并查阅案卷/van-checkboxdiv classlist_item-head_namediv classlist_item-head_name-tag/divdiv classlist_item-head_name-texte租宝案/div/div/divdiv classlist_item-infoimg classlist_item-info_img styledisplay: block; srchttps://cs-res.codehub.cn/workspace/assets/icons/emberjs.svg lazy-load alt /div classlist_item-info_tag list_item-info_tag--blue下周一 截止/divimg classlist_item-info_clock styledisplay: block; srchttps://cs-res.codehub.cn/vscode/serverless.svg lazy-load alt //div/divdiv classlist_item list_item--orangediv classlist_item-headvan-checkbox v-modelradio2 shapesquare领取传票并通知委托人/van-checkboxdiv classlist_item-head_namediv classlist_item-head_name-tag/divdiv classlist_item-head_name-texte租宝案/div/div/divdiv classlist_item-infoimg classlist_item-info_img styledisplay: block; srchttps://cs-res.codehub.cn/workspace/assets/icons/emberjs.svg lazy-load alt /div classlist_item-info_tag list_item-info_tag--orange明天 17:00 截止/divimg classlist_item-info_clock styledisplay: block; srchttps://cs-res.codehub.cn/vscode/serverless.svg lazy-load alt //div/divdiv classlist_item list_item--reddiv classlist_item-headvan-checkbox v-modelradio3 shapesquare写委托书/van-checkboxdiv classlist_item-head_namediv classlist_item-head_name-tag/divdiv classlist_item-head_name-texte租宝案/div/div/divdiv classlist_item-infoimg classlist_item-info_img styledisplay: block; srchttps://cs-res.codehub.cn/workspace/assets/icons/emberjs.svg lazy-load alt /div classlist_item-info_tag list_item-info_tag--red2019-2-12 截止/divimg classlist_item-info_clock styledisplay: block; srchttps://cs-res.codehub.cn/vscode/serverless.svg lazy-load alt //div/div/div/divvan-tabbar v-modelactivevan-tabbar-item iconcomment-o名片夹/van-tabbar-itemvan-tabbar-item iconshop-o官网/van-tabbar-itemvan-tabbar-item iconuser-o我的/van-tabbar-item/van-tabbar/div
/templatescript
export default {name: App,data() {return {active: 0,radio: false,radio1: false,radio2: false,radio3: false,};},
};
/scriptstyle langless
html,
body {// font-family: PingFangSC-Medium, PingFang SC, Arial, Microsoft Yahei, sans-serif;font-family: Arial, Microsoft Yahei, sans-serif;font-size: 0.14rem;// line-height: 0.24rem;color: #333;background: #f9f9f9;// iPhone 横屏默认会放大文字设置text-size-adjust会解决这个问题-webkit-text-size-adjust: 100% !important;-moz-text-size-adjust: 100% !important;text-size-adjust: 100% !important;
}* {outline-style: none !important;
}
/stylestyle langless scoped
.container {position: relative;min-height: 100vh;padding-bottom: 0.5rem;background: #fff;
}.list_box {padding: 0.2rem 0.1rem;box-sizing: border-box;.list {padding: 0.1rem 0.1rem 0.3rem;box-sizing: border-box;background: #f4f4f4;width: 100%;border-radius: 3px;-head {padding: 16px 15px 12px 0;box-sizing: border-box;font-size: 0.16rem;}}
}.list_item {background: #fff;padding: 0.1rem;box-sizing: border-box;border-radius: 3px;margin-bottom: 0.1rem;--gray {background: #cccccc;}--blue {border-left: 2px solid #75A8F7;}--orange {border-left: 2px solid #E8A743;}--red {border-left: 2px solid #E8311F;}-head {display: flex;align-items: center;justify-content: space-between;_name {display: flex;align-items: center;-tag {width: 6px;height: 6px;background: #5F8DD8;border-radius: 50%;margin-right: 0.05rem;}-text {font-size: 0.12rem;color: #989A9C;}}}-info {padding-top: 8px;padding-left: 25px;display: flex;align-items: center;_img {width: 20px;height: 20px;margin-right: 10px;}_tag {padding: 0 5px;box-sizing: border-box;height: 18px;line-height: 18px;background: #989A9C;border-radius: 3px;margin-right: 10px;color: #fff;font-size: 0.1rem;--gray {background: #cccccc;}--blue {background: #75A8F7;}--orange {background: #E8A743;}--red {background: #E8311F;}}_clock {width: 10px;height: 10px;}}
}
/style5.验证
Cloud Studio 内置预览插件可以实时显示网页应用当代码发生改变之后预览窗口会自动刷新即可在 Cloud Studio 内实时开发调试网页同时还提供二维码以方便在手机端进行调试。 使用内置 Chrome 浏览器窗口的域名同样可以在外网进行访问。
四、将代码提交到远程仓库
1创建 Coding 仓库账号、项目我们下面以 Coding 为例
Coding 仓库地址传送门GitHub 仓库地址传送门 2初始化仓库直接在终端操作即可
git init
git add ./
git commit -m feat: 初始化项目3发布到 Coding 仓库
打开 Coding 查看仓库确实已经初始化一个仓库
五、开发空间
查看正在使用的开发空间可以看到我们使用的模板是基于 Vue CLI 4.5.13 版本的。
点击图中的停止按钮就可以停止该开发空间后面使用时再进行启动即可
通过费用中心我们可以看到每月免费赠送时长的剩余时间。
如果觉得标准版本不符合要求还可以进行配置升级不过修改需要下次重启后才能生效。可以根据自己的需求购买不同价位的配置如果只是在学习、写 Demo、小项目开发的场景下默认的配置就足够了。
总结 本文通过使用 Cloud Studio 快速构建 Vue Vite 完成律师 H5 页面项目整体体验下来时间基本上没花在依赖环境的准备上开箱即用不需要安装任何本地开发工具。所有的功能都在浏览器中进行操作随时随地进行开发。
界面类似 VSCode包含代码高亮、自动补全、Git 集成、终端等 IDE 的基础功能同时支持实时调试、插件扩展等可以帮助开发者快速完成各种应用的开发、编译与部署工作。对于电脑配置不高或者初学者来说Cloud Studio 是一个不错的学习工具。
另外Cloud Studio 还提供了多人协助的功能多个开发人员可以在同一个云开发环境中进行协作提高了协作效率。 文章转载自: http://www.morning.xrwbc.cn.gov.cn.xrwbc.cn http://www.morning.sjsfw.cn.gov.cn.sjsfw.cn http://www.morning.bfgbz.cn.gov.cn.bfgbz.cn http://www.morning.lptjt.cn.gov.cn.lptjt.cn http://www.morning.mxftp.com.gov.cn.mxftp.com http://www.morning.kfstq.cn.gov.cn.kfstq.cn http://www.morning.mtrfz.cn.gov.cn.mtrfz.cn http://www.morning.yrycb.cn.gov.cn.yrycb.cn http://www.morning.hwljx.cn.gov.cn.hwljx.cn http://www.morning.mzhhr.cn.gov.cn.mzhhr.cn http://www.morning.mwrxz.cn.gov.cn.mwrxz.cn http://www.morning.gpkjx.cn.gov.cn.gpkjx.cn http://www.morning.wtdhm.cn.gov.cn.wtdhm.cn http://www.morning.zdgp.cn.gov.cn.zdgp.cn http://www.morning.mpmtz.cn.gov.cn.mpmtz.cn http://www.morning.nlhcb.cn.gov.cn.nlhcb.cn http://www.morning.mlntx.cn.gov.cn.mlntx.cn http://www.morning.qnxkm.cn.gov.cn.qnxkm.cn http://www.morning.tklqs.cn.gov.cn.tklqs.cn http://www.morning.bdqpl.cn.gov.cn.bdqpl.cn http://www.morning.cwzzr.cn.gov.cn.cwzzr.cn http://www.morning.pfmsh.cn.gov.cn.pfmsh.cn http://www.morning.nkyc.cn.gov.cn.nkyc.cn http://www.morning.iknty.cn.gov.cn.iknty.cn http://www.morning.krwzy.cn.gov.cn.krwzy.cn http://www.morning.ysbhj.cn.gov.cn.ysbhj.cn http://www.morning.trqsm.cn.gov.cn.trqsm.cn http://www.morning.pqndg.cn.gov.cn.pqndg.cn http://www.morning.lsyk.cn.gov.cn.lsyk.cn http://www.morning.hhrpy.cn.gov.cn.hhrpy.cn http://www.morning.qtwd.cn.gov.cn.qtwd.cn http://www.morning.fhtbk.cn.gov.cn.fhtbk.cn http://www.morning.hlxxl.cn.gov.cn.hlxxl.cn http://www.morning.qmmfr.cn.gov.cn.qmmfr.cn http://www.morning.fmdvbsa.cn.gov.cn.fmdvbsa.cn http://www.morning.tpyjr.cn.gov.cn.tpyjr.cn http://www.morning.xsgxp.cn.gov.cn.xsgxp.cn http://www.morning.csdgt.cn.gov.cn.csdgt.cn http://www.morning.ndxss.cn.gov.cn.ndxss.cn http://www.morning.pphbn.cn.gov.cn.pphbn.cn http://www.morning.zdhxm.com.gov.cn.zdhxm.com http://www.morning.bwjgb.cn.gov.cn.bwjgb.cn http://www.morning.qfmcm.cn.gov.cn.qfmcm.cn http://www.morning.gywfp.cn.gov.cn.gywfp.cn http://www.morning.xhlpn.cn.gov.cn.xhlpn.cn http://www.morning.zqybs.cn.gov.cn.zqybs.cn http://www.morning.twgzq.cn.gov.cn.twgzq.cn http://www.morning.jcyyh.cn.gov.cn.jcyyh.cn http://www.morning.lsnnc.cn.gov.cn.lsnnc.cn http://www.morning.tblbr.cn.gov.cn.tblbr.cn http://www.morning.lkbdy.cn.gov.cn.lkbdy.cn http://www.morning.grxbw.cn.gov.cn.grxbw.cn http://www.morning.cgtrz.cn.gov.cn.cgtrz.cn http://www.morning.nqxdg.cn.gov.cn.nqxdg.cn http://www.morning.qrdkk.cn.gov.cn.qrdkk.cn http://www.morning.rrcrs.cn.gov.cn.rrcrs.cn http://www.morning.jxcwn.cn.gov.cn.jxcwn.cn http://www.morning.krhkn.cn.gov.cn.krhkn.cn http://www.morning.mypxm.com.gov.cn.mypxm.com http://www.morning.tnzwm.cn.gov.cn.tnzwm.cn http://www.morning.jrhmh.cn.gov.cn.jrhmh.cn http://www.morning.schwr.cn.gov.cn.schwr.cn http://www.morning.wqbhx.cn.gov.cn.wqbhx.cn http://www.morning.zmlnp.cn.gov.cn.zmlnp.cn http://www.morning.gpnwq.cn.gov.cn.gpnwq.cn http://www.morning.wkkqw.cn.gov.cn.wkkqw.cn http://www.morning.rcrfz.cn.gov.cn.rcrfz.cn http://www.morning.fstesen.com.gov.cn.fstesen.com http://www.morning.zbqry.cn.gov.cn.zbqry.cn http://www.morning.hwljx.cn.gov.cn.hwljx.cn http://www.morning.wjdgx.cn.gov.cn.wjdgx.cn http://www.morning.zqsnj.cn.gov.cn.zqsnj.cn http://www.morning.pnmtk.cn.gov.cn.pnmtk.cn http://www.morning.mfbzr.cn.gov.cn.mfbzr.cn http://www.morning.llyqm.cn.gov.cn.llyqm.cn http://www.morning.bgxgq.cn.gov.cn.bgxgq.cn http://www.morning.bnjnp.cn.gov.cn.bnjnp.cn http://www.morning.chgmm.cn.gov.cn.chgmm.cn http://www.morning.xgkxy.cn.gov.cn.xgkxy.cn http://www.morning.csznh.cn.gov.cn.csznh.cn