这里的Element是指com.google.gwt.dom.client.Element
因为GWT里面有不止一个Element类,所以请不要混淆
Element表示的是js里面的element对象,看一下他源代码里的部分方法
/**
* 这是我们在js中常用的innerHTML方法,使用了JSNI
*/
public final native void setInnerHTML(String html) /*-{
this.innerHTML = html || '';
}-*/;
/**
* 获得该Element里面的html代码,这里并没有直接使用JSNI,因为不同的浏览器实现这个功能的方法不一样,这里的代码在执行的时候,会根据你的浏览器来选择不同的实现类来执行
*/
public final String getInnerHTML() {
return DOMImpl.impl.getInnerHTML(this);
}
/**
* 获得这个Element的Tag标记
*/
public final native String getTagName() /*-{
return this.tagName;
}-*/;
/**
* Adds a new attribute. If an attribute with that name is already present in
* the element, its value is changed to be that of the value parameter.
*
* @param name The name of the attribute to create or alter
* @param value Value to set in string form
设置这个Element上的属性和值,如果该属性还没有,则创建,如果已经存在,则替换
*/
public final native void setAttribute(String name, String value) /*-{
this.setAttribute(name, value);
}-*/;
/**
* The class attribute of the element. This attribute has been renamed due to
* conflicts with the "class" keyword exposed by many languages.
*
* 设置Element上的class属性
*/
public final native void setClassName(String className) /*-{
this.className = className;
}-*/;
/**
* The element's identifier.
*
* 设置Element上的id属性
*/
public final native void setId(String id) /*-{
this.id = id;
}-*/;
Element有很多子类,基本上都是按照tag来分类的
如AnchorElement对应的是<a></a>
AreaElement对应的是<area></area>
FormElement对应的是<form></form>
等等。。。。
对应不同的tag类型,会提供不同的方法来设置特有的属性
分享到:
相关推荐
element-plus@2.5.5 本地离线资源,适用于没有网络连接、搭建自己的cdn等用途。 All files(包含文件) /npm/element-plus@2.5.5/dist /npm/element-plus@2.5.5/es /npm/element-plus@2.5.5/lib /npm/element-...
vue3-element-admin 是【有来开源组织】基于 Vue3 + Vite4 + TypeScript + Element-Plus + Pinia 等前端主流技术栈从0到1搭建后台管理系统模板(前后端开源)。 后端是基于 Spring Boot 3.0 、Spring Security 6.0 ...
若element-ui显示故障: 1.查看是否引用 <!--引入 element-ui 的样式,--> <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> <!-- 必须先引入vue, 后使用element-ui -->...
element plus cdn 中文包 <link rel="stylesheet" href="./element-plus@1.0.2/index.css"> <script src="element-plus@1.0.2/index.js"> <script src="element-plus@1.0.2/element_plus_es.js"> <script src="...
it particularly suited for programming the finite element method. In addition, it also allows the reader to focus on the finite element method by alleviating the programming burden. Experience has ...
基于Vue3+Element Plus后台管理系统模版源码.zip基于Vue3+Element Plus后台管理系统模版源码.zip基于Vue3+Element Plus后台管理系统模版源码.zip基于Vue3+Element Plus后台管理系统模版源码.zip基于Vue3+Element ...
element-ui.rar element-ui核心库压缩包
Element-ui css非网络引用 <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css1"> <link rel="stylesheet" href="/js/vue/index.css"> ...
本地引用示例: <!... <title>my ... <link rel="stylesheet" href="/my/html/element-ui/lib/theme-chalk/index.css"> <el-col :span="24"><div class="myclass"></div></el-col> </el-row>
vue+echarts+element ui+django 前后端分离考勤系统源码 vue+echarts+element ui+django 前后端分离考勤系统源码 vue+echarts+element ui+django 前后端分离考勤系统源码 vue+echarts+...
vue-element-admin项目导入和导出的实现 vue-element-admin导入组件封装 模板和样式 首先封装一个类似的组件,首先需要注意的是,类似功能,vue-element-admin已经提供了,我们只需要改造即可 excel导入功能...
内容概要:该 Vue3-demo 是基于 Vue3 框架搭配 Element-Plus ui库,建立的简单工程,并搭建了 Mockjs 和 axios工具,可以快速开发的工程,已经成功引入并建立了一个基于 Element-Plus 库中 table 组件的页面;...
对于小白来说怎么在Vuedraggable里使用element组件提供了实际应用参考。table样式完全模拟了el-table组件样式。看官方文档两天也不如直接看一个完整的实例。 需要安装依赖:npm i -S vuedraggable@next
Vue3.0+TypeScript+Element-Plus编写的一套后台管理系统(兼容移动端),使用了最新的vue3 vite2 Element-Plus TypeScript等主流技术开发,开箱即用的中后台前端解决方案,也可用于学习参考。 Vue3.0+TypeScript+...
element深色系资源案例,配置深色系vue+element,可在element官网的主题中上传配置文件config.json,就能看到深色系的配置效果,同时可以再项目中引入该资源,实现动态换肤
1. Element_Components_v2.1.0.rplib 从element ui 官网下载的axure组件,可以直接导入到axure中进行使用。 点击+组件处的加号,将文件解压,选择里面的文件导入就能用了。 如果前端使用elementui , 那么我们使用...
Vue 3.0+Vite 2.0+Vue-Router4.0+Element-Plus+Echarts 5.0+Axios 开发的后台管理系统 Vue 3.0+Vite 2.0+Vue-Router4.0+Element-Plus+Echarts 5.0+Axios 开发的后台管理系统 Vue 3.0+Vite 2.0+Vue-Router4.0+...
vue-element-admin完整版的(内有node_modules)开箱即用,可以直接 npm run dev,(完全免费),首先声明,博主也是踩了很多坑,最终花费了三天的空余时间git到这个完整版的前端参考文件,适合做课程设计,快速开发...
elementUI官网给出,可以基于cdn引入文件使用elementUI,但是对于无法访问外网的项目,是没法使用的,因此使用该资源,基于cdn的element-ui的unpkg文件,将其直接下载至本地项目中,后页面head中引入: ...