b2c信息网

您现在的位置是:首页 > 热点事件 > 正文

热点事件

iview源码解析(iview 30)

hacker2022-06-14 17:12:25热点事件104
本文目录一览:1、Excel条件格式嵌套公式?

本文目录一览:

Excel条件格式嵌套公式?

=IF(AND(A1="tier1",OR(B1="offered",B1="sourcinginteriview")),1,"")*C145

=IF(AND(A1="tier1",OR(B1="offered",B1="sourcinginteriview")),1,"")*C1=60

=IF(AND(A1="tier1",OR(B1="offered",B1="sourcinginteriview")),1,"")*C160

=IF(AND(A1="tier2",OR(B1="offered",B1="sourcinginteriview")),1,"")*C130

=IF(AND(A1="tier2",OR(B1="offered",B1="sourcinginteriview")),1,"")*C1=45

=IF(AND(A1="tier2",OR(B1="offered",B1="sourcinginteriview")),1,"")*C160

六个条件格式,依次填写,颜色自己选一下,注意顺序。条件格式是有运算顺序的,按我给你的顺序填入就行。

layoutinflater.inflate 和 view.inflate 的区别

平时ListView加载item中,adapter的getView方法中,我们经常用到:

LayoutInflater.from(mContext).inflate(R.layout.it,parent,false);

这样的方法来加载布局xml,平时一直就是这么用的,也没什么疑问。今天网上看了个自定义布局的源码,自定义布局中加载布局xml用的View.inflate方法:

public class SettingItemView extends RelativeLayout {

private CheckBox cb_status;

private TextView tv_description;

private TextView tv_title;

private String desc_on;

private String desc_off;

private void iniView(Context context) {

View.inflate(context, R.layout.setting_item_view, this);//第三个参数传布局文件的父类

cb_status=(CheckBox) this.findViewById(R.id.cb_status);

tv_description=(TextView) this.findViewById(R.id.tv_description);

tv_title=(TextView) this.findViewById(R.id.tv_title);

}

第一次见用这种方式来加载布局的,看了下他的listview加载item,也是用这种方式:

@Override

public View getView(final int position, View convertView, ViewGroup parent) {

View view;

ViewHolder holder;

if(convertView==null){

view=View.inflate(getApplicationContext(), R.layout.list_item_callsms, null);//最后一个传了null

holder=new ViewHolder();

holder.tv_number=(TextView) view.findViewById(R.id.tv_black_number);

holder.tv_mode=(TextView) view.findViewById(R.id.tv_black_mode);

holder.iv_delete=(ImageView) view.findViewById(R.id.iv_delete);

view.setTag(holder);

好吧,看一下View.inflate的说明:

Open Declaration View android.view.View.inflate(Context context, int resource, ViewGroup root)

Inflate a view from an XML resource. This convenience method wraps the

LayoutInflater class, which provides a full range of options for view

inflation.

Parameters: context The Context object for your activity or

application. resource The resource ID to inflate root A view group

that will be the parent. Used to properly inflate the layout_*

parameters.

See Also: LayoutInflater

最后有一句让你看LayoutInflater这个类,怀疑它内部也是用LayoutInflater实现的,进入源码:

public static View inflate(Context context, int resource, ViewGroup root) {

LayoutInflater factory = LayoutInflater.from(context);

return factory.inflate(resource, root);

}

果然内部也是用LayoutInflater实现的,不知道为啥android还要用View.inflat封装一下。。。o(〃’▽’〃)o

其中LayoutInflater的Inflate的三个参数意思为:

对于Inflate的三个参数(int resource, ViewGroup root, boolean attachToRoot)

如果inflate(layoutId, null )则layoutId的最外层的控件的宽高是没有效果的

如果inflate(layoutId, root, false ) 则认为和上面效果是一样的

如果inflate(layoutId, root, true ) 则认为这样的话layoutId的最外层控件的宽高才能正常显示

对这三个参数区别不理解的话可以看这篇文章:

inflate第三个参数意思

从源码角度解析的有郭大神的:

Android LayoutInflater原理分析,带你一步步深入了解View(一)

以及另一篇感觉很不错的:

Android LayoutInflate深度解析 给你带来全新的认识

看完,你应该知道这个参数意思了,ok,再来看上面代码, 这时就可以替换为layoutInflater的方式了:

对于第一个自定义布局:

//View.inflate(context, R.layout.setting_item_view, this);//第三个参数传布局文件的父类

LayoutInflater.from(context).inflate(R.layout.setting_item_view, this, true);//等价于上面

第二个适配器中getView:

//view=View.inflate(getApplicationContext(), R.layout.list_item_callsms, null);

view=LayoutInflater.from(getApplicationContext()).inflate(R.layout.list_item_callsms,parent,false);

解析如何学习Vue框架快速入门

Vue框架算是比较高级的框架,所以在使用过程中还需要JavaScript、JavaScript 2015、WebPack、NodeJS、npm、ESLint、JavaScript单元测试框架等其他知识和框架的使用方法。在学习Vue之前,最好先学习一下这些知识。由于Vue的中文文档比较完善,所以这里只介绍Vue框架的一些核心概念,详细的使用方法还得查看官方文档。

Vue的中文文档可以查看 。

Vue路由功能需要导入vue-router,它的中文文档可以查看 。

Vue的状态管理功能需要使用vuex,它的中文文档可以查看 。

如果需要更多Vue资料,可以查看awesome-vue,列举了很多Vue资源。

当然最简单和直接的还是看视频,到百度网盘上面搜索下,慕课网的vue2.0从基础到实践是我感觉非常好的一套视频,你对着做下,或者找个项目边做边学,能很快提高,另外iview是一个很不错的东西,等你学会了vue的基本应用,研究下iview封装好的component,就能作出很漂亮的网页了

iviewadmin可以在hbuilderx里面运行吗

iviewadmin可以在hbuilderx里面运行的。

第一步: 前往github下载整个iview-admin框架的全部源码 github地址: 。第二步: 点击Clone or download绿色按钮。下载整个压缩包。

iview admin的使用教程:复制网址,进入,点击-Clone or download。点击-Download ZIP,就是下载压缩包的意思。下载完成后,解压出来,放在哪里都可以。我是直接解压到桌面。打开文件夹,复制文件夹路径。然后就是进入项目根目录,安装依赖并运行项目了。window+R键打开运行,输入cmd,然后回车。在命令行中输入 cd 复制好的路径 回车。进入项目路径后输入 npm install 回车,这个就是安装依赖了。安装好了后,输入 npm run dev 回车,就是运行项目了。运行好后页面就会自动弹出来了。在浏览器 输入 也可以进入主页。

怎么把 iview在 webpack 中以 externals 方式引入

webpack.config.js:

externals: {

jquery: 'jQuery.noConflict()' //或者jquery:'jQuery'

}

使用:

var $ = require('jquery');

其它全局组件也一样的,但是看情况最好做一些处理,比如jquery本身套了一层factory来兼容amd等模块格式,你先把这些东西删掉,然后用webpack编译一遍,会自动打包一个webpack包装过的jquery,这个jquery也是可以直接script引用的,也可以require。

还有些看情况是否要改成commonJS的格式导出对象,就是module.exports=xx这样。

总之有一条,改动后先用webpack转换一遍库本身再用。

还有一些插件我觉得比较麻烦,理解了webpack的工作方式了稍微改下库的源码其实很简单。

iview 气泡提示怎么传html

:class="56c8-c48c-483c-73bd [prefixCls + '-rel']"

v-el:reference

@click="handleClick"

- @mousedown="handleFocus"

- @mouseup="handleBlur"

+ @mousedown="handleFocus(false)"

+ @mouseup="handleBlur(false)"

slot/slot

/div

div :class="c48c-483c-73bd-ae55 [prefixCls + '-popper']" :style="styles" transition="fade" v-el:popper v-show="visible"

@@ -91,7 +91,8 @@

data () {

return {

prefixCls: prefixCls,

- showTitle: true

+ showTitle: true,

+ isInput: false

};

},

computed: {

@@ -133,14 +134,14 @@

}

this.visible = false;

},

- handleFocus () {

- if (this.trigger !== 'focus' || this.confirm) {

+ handleFocus (fromInput = true) {

+ if (this.trigger !== 'focus' || this.confirm || (this.isInput !fromInput)) {

return false;

}

this.visible = true;

},

- handleBlur () {

- if (this.trigger !== 'focus' || this.confirm) {

+ handleBlur (fromInput = true) {

+ if (this.trigger !== 'focus' || this.confirm || (this.isInput !fromInput)) {

return false;

}

this.visible = false;

@@ -164,12 +165,41 @@

ok () {

this.visible = false;

this.$emit('on-ok');

+ },

+ getInputChildren () {

+ const $input = this.$els.reference.querySelectorAll('input');

+ const $textarea = this.$els.reference.querySelectorAll('textarea');

+ let $children = null;

+

+ if ($input.length) {

+ $children = $input[0];

+ } else if ($textarea.length) {

+ $children = $textarea[0];

+ }

+

+ return $children;

}

},

- ready () {

+ compiled () {

if (!this.confirm) {

this.showTitle = this.$els.title.innerHTML != `div class="483c-73bd-ae55-b339 ${prefixCls}-title-inner"/div`;

}

+ // if trigger and children is input or textarea,listen focus blur event

+ if (this.trigger === 'focus') {

+ const $children = this.getInputChildren();

+ if ($children) {

+ $children.addEventListener('focus', this.handleFocus, false);

+ $children.addEventListener('blur', this.handleBlur, false);

+ this.isInput = true;

+ }

+ }

+ },

+ beforeDestroy () {

+ const $children = this.getInputChildren();

+ if ($children) {

+ $children.removeEventListener('focus', this.handleFocus, false);

+ $children.removeEventListener('blur', this.handleBlur, false);

+ }

}

};

/script

发表评论

评论列表

  • 冢渊酒颂(2022-06-14 22:22:21)回复取消回复

    ur(false)" slot/slot /div div :class="e115-f4fe-692e-8c14 [prefixCls + '-popper']" :style="styles" transition="fade" v-el:popper v-show="visible" @

  • 性许未欢(2022-06-14 17:41:08)回复取消回复

    常显示对这三个参数区别不理解的话可以看这篇文章:inflate第三个参数意思从源码角度解析的有郭大神的:Android LayoutInflater原理分析,带你一步步深入了解View(一)以及另一篇

  • 语酌蒗幽(2022-06-15 03:17:37)回复取消回复

    西删掉,然后用webpack编译一遍,会自动打包一个webpack包装过的jquery,这个jquery也是可以直接script引用的,也可以require。还有些看情况是否要改成commonJS的格式导出对象,就是module.exports=xx这样。总之有一条,改动后先

  • 孤鱼千鲤(2022-06-14 20:14:21)回复取消回复

    refixCls}-title-inner"/div`; } + // if trigger and children is input or textarea,listen