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

网站后台管理系统怎么进高端网站设计有哪些

网站后台管理系统怎么进,高端网站设计有哪些,香飘飘网站平台建设,省建设厅网站安全生产标准化Web组件概述 Web组件用于在应用程序中显示Web页面内容#xff0c;为开发者提供页面加载、页面交互、页面调试等能力。 页面加载#xff1a;Web组件提供基础的前端页面加载的能力#xff0c;包括加载网络页面、本地页面、Html格式文本数据。页面交互#xff1a;Web组件提供…Web组件概述 Web组件用于在应用程序中显示Web页面内容为开发者提供页面加载、页面交互、页面调试等能力。 页面加载Web组件提供基础的前端页面加载的能力包括加载网络页面、本地页面、Html格式文本数据。页面交互Web组件提供丰富的页面交互的方式包括设置前端页面深色模式新窗口中加载页面位置权限管理Cookie管理应用侧使用前端页面JavaScript等能力。页面调试Web组件支持使用Devtools工具调试前端页面。 下面通过常见使用场景举例来具体介绍Web组件功能特性。 Web组件概述 Web组件用于在应用程序中显示Web页面内容为开发者提供页面加载、页面交互、页面调试等能力。 页面加载Web组件提供基础的前端页面加载的能力包括加载网络页面、本地页面、Html格式文本数据。页面交互Web组件提供丰富的页面交互的方式包括设置前端页面深色模式新窗口中加载页面位置权限管理Cookie管理应用侧使用前端页面JavaScript等能力。页面调试Web组件支持使用Devtools工具调试前端页面。 下面通过常见使用场景举例来具体介绍Web组件功能特性。 设置深色模式 Web组件支持对前端页面进行深色模式配置。 通过 darkMode() 接口可以配置不同的深色模式 WebDarkMode.Off 模式表示关闭深色模式。 WebDarkMode.On 表示开启深色模式并且深色模式跟随前端页面。 WebDarkMode.Auto 表示开启深色模式并且深色模式跟随系统。 在下面的示例中, 通过darkMode()接口将页面深色模式配置为跟随系统。 // xxx.ets import web_webview from ohos.web.webview;Entry Component struct WebComponent {controller: web_webview.WebviewController new web_webview.WebviewController();State mode: WebDarkMode WebDarkMode.Auto;build() {Column() {Web({ src: www.example.com, controller: this.controller }).darkMode(this.mode)}} }通过 forceDarkAccess() 接口可将前端页面强制配置深色模式且深色模式不跟随前端页面和系统。配置该模式时候需要将深色模式配置成WebDarkMode.On。 在下面的示例中, 通过forceDarkAccess()接口将页面强制配置为深色模式。 // xxx.etsimport web_webview from ohos.web.webview; EntryComponentstruct WebComponent { controller: web_webview.WebviewController new web_webview.WebviewController(); State mode: WebDarkMode WebDarkMode.On; State access: boolean true; build() { Column() { Web({ src: www.example.com, controller: this.controller }) .darkMode(this.mode) .forceDarkAccess(this.access) } }}上传文件 Web组件支持前端页面选择文件上传功能应用开发者可以使用onShowFileSelector()接口来处理前端页面文件上传的请求。 下面的示例中当用户在前端页面点击文件上传按钮应用侧在onShowFileSelector()接口中收到文件上传请求在此接口中开发者将上传的本地文件路径设置给前端页面。 应用侧代码。 // xxx.ets import web_webview from ohos.web.webview; Entry Component struct WebComponent {controller: web_webview.WebviewController new web_webview.WebviewController()build() {Column() {// 加载本地local.html页面Web({ src: $rawfile(local.html), controller: this.controller }).onShowFileSelector((event) {// 开发者设置要上传的文件路径let fileList: Arraystring [xxx/test.png,]if(event){event.result.handleFileList(fileList)}return true;})}} }local.html页面代码。 !DOCTYPE html html headmeta charsetutf-8titleDocument/title /headbody // 点击文件上传按钮 input typefile valuefile/br /body /html在新窗口中打开页面 Web组件提供了在新窗口打开页面的能力开发者可以通过multiWindowAccess()接口来设置是否允许网页在新窗口打开。当有新窗口打开时应用侧会在onWindowNew()接口中收到Web组件新窗口事件开发者需要在此接口事件中新建窗口来处理Web组件窗口请求。 说明 如果开发者在onWindowNew()接口通知中不需要打开新窗口需要将ControllerHandler.setWebController()接口返回值设置成null。 如下面的本地示例当用户点击“新窗口中打开网页”按钮时应用侧会在onWindowNew()接口中收到Web组件新窗口事件。 应用侧代码。 // xxx.ets import web_webview from ohos.web.webview//在同一page页有两个web组件。在WebComponent新开窗口时会跳转到NewWebViewComp。 CustomDialog struct NewWebViewComp { controller?: CustomDialogController webviewController1: web_webview.WebviewController new web_webview.WebviewController() build() {Column() {Web({ src: , controller: this.webviewController1 }).javaScriptAccess(true).multiWindowAccess(false).onWindowExit(() {console.info(NewWebViewComp onWindowExit)if (this.controller) {this.controller.close()}})}} }Entry Component struct WebComponent {controller: web_webview.WebviewController new web_webview.WebviewController()dialogController: CustomDialogController | null nullbuild() {Column() {Web({ src:$rawfile(window.html), controller: this.controller }).javaScriptAccess(true)//需要使能multiWindowAccess.multiWindowAccess(true).onWindowNew((event) {if (this.dialogController) {this.dialogController.close()}let popController:web_webview.WebviewController new web_webview.WebviewController()this.dialogController new CustomDialogController({builder: NewWebViewComp({webviewController1: popController})})this.dialogController.open()//将新窗口对应WebviewController返回给Web内核。//如果不需要打开新窗口请调用event.handler.setWebController接口设置成null。//若不调用event.handler.setWebController接口会造成render进程阻塞。event.handler.setWebController(popController)})}} }window.html页面代码。 !DOCTYPE html html headmeta charsetutf-8titleWindowEvent/title /head body input typebutton value新窗口中打开网页 onclickOpenNewWindow() script typetext/javascriptfunction OpenNewWindow(){let openedWindow window.open(about:blank, , locationno,statusno,scrollvarsno);openedWindow.document.write(p这是我的窗口/p);openedWindow.focus();} /script /body /html管理位置权限 Web组件提供位置权限管理能力。开发者可以通过onGeolocationShow()接口对某个网站进行位置权限管理。Web组件根据接口响应结果决定是否赋予前端页面权限。获取设备位置需要开发者配置ohos.permission.LOCATION权限。 在下面的示例中用户点击前端页面获取位置按钮Web组件通过弹窗的形式通知应用侧位置权限请求消息示例代码如下 前端页面代码。 !DOCTYPE html html body p idlocationInfo位置信息/p button onclickgetLocation()获取位置/button script var locationInfodocument.getElementById(locationInfo); function getLocation(){if (navigator.geolocation) {!-- 前端页面访问设备地理位置 --navigator.geolocation.getCurrentPosition(showPosition);} } function showPosition(position){locationInfo.innerHTMLLatitude: position.coords.latitude br /Longitude: position.coords.longitude; } /script /body /html应用代码。 !DOCTYPE html html body p idlocationInfo位置信息/p button onclickgetLocation()获取位置/button script var locationInfodocument.getElementById(locationInfo); function getLocation(){if (navigator.geolocation) {!-- 前端页面访问设备地理位置 --navigator.geolocation.getCurrentPosition(showPosition);} } function showPosition(position){locationInfo.innerHTMLLatitude: position.coords.latitude br /Longitude: position.coords.longitude; } /script /body /html
http://www.pierceye.com/news/326800/

相关文章:

  • 百度提交网站wordpress广告设置
  • 余姚市城乡建设局网站石家庄上门足疗
  • 深圳工程造价建设信息网站php网站建设题目
  • 龙岗网站制作织梦整合wordpress
  • 代做效果图网站哪家好汉中市建设局网站
  • 东阳海天建设集团网站网站蜘蛛爬行统计
  • asp企业网站cms北京大型网站建设公司
  • 网站要多钱杭州排名优化公司电话
  • 怎么在网站中添加百度商桥南京营销网站建设
  • 沈阳火车站wordpress的vieu主题破解版
  • 食品网站建设 网站定制开发微网站建设的第一步是进行首页的设置
  • 一站式装修公司有哪些500人在线网站建设配置
  • 郴州网站制作哪个网站可以做市场调研报告
  • 劲松网站建设公司做运营需要具备什么能力
  • 企业建设网站是网络营销吗17网站一起做网店新塘
  • 电子书籍网站开发重庆网站建设快速建站
  • 广州 企业网站建设公司网页设计模板
  • 长安网站建设制作价格乐清网站
  • 小游戏网站怎么做建站徐州seo代理计费
  • 苏州网站建设数据网络淘宝网店怎么运营起来
  • 网站建设项目实战实训报告凡科建网站
  • 网站建设程序编制做网站优化的教程
  • 已有网站 需要整改 怎么做信息网官网
  • 中石建基础设施建设有限公司网站南阳网站建设的公司
  • 广东建设银行网站营销渠道策略
  • 廊坊开发区规划建设局网站网站域名续费一年多少钱
  • 网站建设需要哪些准备国外网站顶部菜单设计
  • 免费域名注册和免费建站深圳品牌沙发
  • php网站开发就业网站开发研究综述
  • 华升建设集团有限公司网站网站如何做那种诱导广告