How to use the omi.render function in omi

To help you get started, we’ve selected a few omi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / packages / omim / demos / list-old / index.js View on Github external
Divider+Inset:
        
        Divider+Padded+Inset:
        
        Disabled
        Selected
        Activated
        }>Graphic
        
        
        }>
      
    
  }
})
render(, 'body')
github Tencent / omi / packages / omi-mp / src / utils / mp.js View on Github external
//set twice
      setTimeout(function () {
        document.documentElement.scrollTop = ele._preScrollTop
        document.body.scrollTop = ele._preScrollTop
      }, 0)
    } else {
      const node = render(vnode, root)
      node.onShow && node.onShow()
      wx.currentPage = node
      document.documentElement.scrollTop = 0
      document.body.scrollTop = 0
    }
  } else {
    const ele = document.querySelector(selector)
    ele && ele.parentNode.removeChild(ele)
    const node = render(vnode, root)
    node.onShow && node.onShow()
    wx.currentPage = node
    document.documentElement.scrollTop = 0
    document.body.scrollTop = 0
  }
}
github Tencent / omi / packages / cax-omip / src / libs / router / index.js View on Github external
}, 0)
    } else {
      const node = render(vnode, root)
      node.onShow && node.onShow()
      node._component && node._component.onShow && node._component.onShow()
      currentPage = node
      document.documentElement.scrollTop = 0
      document.body.scrollTop = 0
    }
  } else {
    //前进
    if (item && item.ele) {
      item.ele.parentNode.removeChild(item.ele)
      remove(item)
    }
    const node = render(vnode, root)
    node.onShow && node.onShow()
    node._component && node._component.onShow && node._component.onShow()
    currentPage = node

    const ele = root.childNodes[root.childNodes.length - 1]
    stackList.push({ slt: selector, ele: ele, display: window.getComputedStyle(ele).display, scrollTop: 0 })
    document.documentElement.scrollTop = 0
    document.body.scrollTop = 0
  }
}
github Tencent / omi / packages / omim / demos / badge / index.js View on Github external
import '../../src/badge/index.tsx'
import '../../src/icon/index.tsx'
import '../../src/icon-button/index.tsx'
import { render, h } from 'omi'

render(
  <div>
    
      
    

    <br><br><br>
    
      
    

    <br><br><br>

    
      
    
</div>
github Tencent / omi / packages / omip / my-app / src / libs / router / index.js View on Github external
//浏览器后退
    if (item && item.ele) {
      const ele = item.ele
      ele.style.display = item.display
      ele.onShow && ele.onShow()
      ele._component && ele._component.onShow && ele._component.onShow()
      currentPage = ele
      document.documentElement.scrollTop = item.scrollTop
      document.body.scrollTop = item.scrollTop
      //set twice
      setTimeout(function () {
        document.documentElement.scrollTop = item.scrollTop
        document.body.scrollTop = item.scrollTop
      }, 0)
    } else {
      const node = render(vnode, root)
      node.onShow && node.onShow()
      node._component && node._component.onShow && node._component.onShow()
      currentPage = node
      document.documentElement.scrollTop = 0
      document.body.scrollTop = 0
    }
  } else {
    //前进
    if (item && item.ele) {
      item.ele.parentNode.removeChild(item.ele)
      remove(item)
    }
    const node = render(vnode, root)
    node.onShow && node.onShow()
    node._component && node._component.onShow && node._component.onShow()
    currentPage = node
github Tencent / omi / packages / omim / demos / color-picker / index.js View on Github external
import '../../src/color-picker/index.tsx'
import { render, h } from 'omi'

render(
  <div>
   
   <div>abc</div>
  </div>
  , 'body')
github Tencent / omi / packages / omim / demos / drawer / index.js View on Github external
background:#fff;
       
      }`}
            items={this.items}

            onItemClick={this.onItemClick}
          &gt;


        
      
    )
  }
})

render(, 'body')
github Tencent / omi / packages / omi-page / examples / simple / main.js View on Github external
this.data.path = ctx.path
        this.update()
    }

    contact = (ctx) =&gt; {
        this.data.path = ctx.path
        this.update()
    }

    notfound = (ctx) =&gt; {
        this.data.path = ctx.path
        this.update()
    }
}

render(, 'body')
github Tencent / omi / packages / omi-cli / template / weui / src / index.js View on Github external
import { render } from 'omi'
import './assets/index.css'
import './elements/app'

import store from './store/app-store'

render(, '#root', store)
github Tencent / omi / packages / omim / demos / scroll / index.js View on Github external
<li>Pretty row 49</li>
              <li>Pretty row 50</li>
            
          
        

      

      <div id="footer"></div>
    

  }
})


render(, 'body')

omi

<p align="center"><img src="https://omijs.github.io/home/assets/logo.svg" alt="omi" width="100"/></p> <h2 align="center">Omi - Web Components Framework</h2>

MIT
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis