简体   繁体   中英

Atom IDE Package

I'm trying out the Atom editor from Github and I really like it. I would like to create a simple (just to learn) plugin. I used the online resources to create the figgle example successfully.

Now I would like to create something with an UI. I would like to add an input field to my UI, but how can I get it to be styled to same way Atom does.

I see in the documentation that I have to create an element with 'atom-text-editor' tag. However this creates an text area with line numbers etc. I just want a single lined input field.

So concrete, my question is: 'How can I create an input field which looks the same as the atom one.'在此处输入图片说明

Found the answer through atom slack chat.

var elem = document.createElement 'atom-text-editor'
element.setAttribute 'mini', ''
element.setAttribute 'placeholder-text', 'Search'

Which gives:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM