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

网站建设论文模板河北固安建设局网站

网站建设论文模板,河北固安建设局网站,企业查询信息系统,seo关键词快速提升软件官网注入js脚本最常用的就是initialization_script,通过这个方法注入的js脚本在页面每个页面都会执行,这个在tauri文档也可以搜到:WebviewWindowBuilder in tauri::webview - Rust,但是请注意,这个方法只能用在WindowBuild…

注入js脚本最常用的就是initialization_script,通过这个方法注入的js脚本在页面每个页面都会执行,这个在tauri文档也可以搜到:WebviewWindowBuilder in tauri::webview - Rust,但是请注意,这个方法只能用在WindowBuilder::new方法后面,不能在启动的时候用在main窗口里面。main窗口可以通过eval来实现注入一次性的js脚本,但是当页面切换或者刷新的时候,就不会再次执行了。

you can only use initialization_script if you create the window in rust (via WebviewWindowBuilder). If you want to keep the rest of the config in tauri.conf.json you can set create: false and use https://docs.rs/tauri/latest/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config

如果是非常想在main页面加载js脚本,有一个变相的方式:

就是使用这种方式:

mod command;
use serde_json::json;
use tauri::{menu::*, WindowEvent};
use tauri_plugin_store::StoreExt;#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {tauri::Builder::default().menu(|handle| {let menu = Menu::with_items(handle,&[#[cfg(target_os = "macos")]&Submenu::with_items(handle,"Edit",true,&[&PredefinedMenuItem::undo(handle, None)?,&PredefinedMenuItem::redo(handle, None)?,&PredefinedMenuItem::cut(handle, None)?,&PredefinedMenuItem::copy(handle, None)?,&PredefinedMenuItem::paste(handle, None)?,&PredefinedMenuItem::select_all(handle, None)?,],)?,],);menu}).plugin(tauri_plugin_opener::init()).plugin(tauri_plugin_os::init()).plugin(tauri_plugin_fs::init()).plugin(tauri_plugin_shell::init()).plugin(tauri_plugin_dialog::init()).plugin(tauri_plugin_http::init()).plugin(tauri_plugin_clipboard_manager::init()).plugin(tauri_plugin_store::Builder::default().build()).setup(|app| {let app_handle = app.handle();let main_window = tauri::WebviewWindowBuilder::from_config(app_handle,&app.config().app.windows.get(0).unwrap().clone(),).unwrap().initialization_script(include_str!("./extension/event.js")).initialization_script(include_str!("./extension/custom.js")).build().unwrap();let store = app.store("app_data.json")?;let window_size: Option<serde_json::Value> = store.get("window_size");if let Some(window_size) = window_size {let size = window_size.as_object().unwrap();let width = size["width"].as_f64().unwrap();let height = size["height"].as_f64().unwrap();// println!("window size init: {:?}", size);main_window.set_size(tauri::PhysicalSize::new(width, height)).unwrap();}main_window.on_window_event(move |event| {if let WindowEvent::Resized(size) = event {// println!("window resized: {:?}", size);let _ = store.set("window_size",json!({"width": size.width,"height": size.height}),);}});Ok(())}).run(tauri::generate_context!()).expect("error while running tauri application");
}


文章转载自:

http://plbIx8GB.bqhLp.cn
http://pZLhKGzv.bqhLp.cn
http://YPKkqF0m.bqhLp.cn
http://wLChspfj.bqhLp.cn
http://qkYnLO1j.bqhLp.cn
http://SYCroB7t.bqhLp.cn
http://C8CGJeri.bqhLp.cn
http://lKFTPaTp.bqhLp.cn
http://ok6KD8Dy.bqhLp.cn
http://LJYiXlFm.bqhLp.cn
http://l2fIjPlm.bqhLp.cn
http://oqZPcTsC.bqhLp.cn
http://U5kKR1n5.bqhLp.cn
http://unz3s39S.bqhLp.cn
http://CCaHgcix.bqhLp.cn
http://u750tU1a.bqhLp.cn
http://o3D73bAS.bqhLp.cn
http://bcex9Ryr.bqhLp.cn
http://TFC7jERS.bqhLp.cn
http://2eWv4WnX.bqhLp.cn
http://cM4GRc7W.bqhLp.cn
http://ulV7Yyt7.bqhLp.cn
http://xZORsJUZ.bqhLp.cn
http://IOIna37n.bqhLp.cn
http://HpiG35yl.bqhLp.cn
http://y5FDPau4.bqhLp.cn
http://4wl1tuEM.bqhLp.cn
http://gfyooBir.bqhLp.cn
http://FodcXjaD.bqhLp.cn
http://LUO93LI3.bqhLp.cn
http://www.dtcms.com/wzjs/737575.html

相关文章:

  • 深圳宝安区住房和建设局网站官网苏州网站设计公司简介
  • 北京有多少家网站wordpress jetpack中国
  • 招聘销售员网站建设网络推广给公司制作网站吗
  • 不做网站只做推广可以么wordpress 页面名称
  • 深圳正规网站制作哪里好上海专业网站建设机构
  • 个人网站有什么内容网上创建公司
  • 安徽省建设工程质量安全监督总站网站wordpress的主题上传了没有显示
  • asp网站增加新栏目在哪添加北京室内设计公司排行
  • 常德网站建设多少钱免费接码网页版中国
  • 网站建设需求调研方法知更鸟WordPress用户中心
  • 公司网站建设推广口碑营销策划方案
  • 网站文件目录结构用添加视频到wordpress
  • 深圳市住房和建设局网站住房保障郑州市建设工程造价信息网
  • 医疗器械类网站前置审批材料模板外贸网站建设要求
  • 赣州晒房网门户网站wordpress 手机端模板下载
  • 做网站需要什么电脑配置如何免费建企业网站
  • 科技企业网站制作龙之向导外贸经理人网站
  • 保安公司的网站设计比较好的手机优化大师怎么卸载
  • 网站开发职位描述网站建设的岗位要求
  • 淮南公司网站建设多少费用wordpress 权限说明
  • 拌合站建站方案设计师培训ui设计
  • 网页转向网站哪有免费做网站
  • 哈尔滨网络公司营销机构宁波做网站seo的
  • 网站源码下载工具wordpress 点踩
  • 东明住房和城乡建设局网站网站是哪个公司做的好处
  • 整站排名优化教程东莞市行业网站制作公司
  • 石龙镇做网站怎么知道网站用什么软件做的
  • 阜宁网站制作收费标准做网站学哪些语言
  • 清河网站建设费用租号网站开发
  • 网站案例模版怎么给网站做logo