# \[Solved\] ヘッダーのドロップダウンハンバーガーウィジェットを上書きするために、virtual-dom の "h" ヘルパーを \<head\> で使う方法 + @computed メソッドを上書きする方法は？

**URL:** <https://meta.discourse.org/t/solved-how-to-use-virtual-doms-h-helper-in-head-for-header-dropdown-hamburger-widget-override-how-to-override-computed-method/104583>\
**Category:** Development\
**Created:** [2018 年 12 月 18 日午後 6:50 UTC](https://meta.discourse.org/t/solved-how-to-use-virtual-doms-h-helper-in-head-for-header-dropdown-hamburger-widget-override-how-to-override-computed-method/104583 "2018-12-18T18:50:30Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![rbrlortie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rbrlortie/32/166740_2.png) [@rbrlortie](https://meta.discourse.org/u/rbrlortie)\
**Post date:** [2018 年 12 月 18 日午後 8:20 UTC](https://meta.discourse.org/t/solved-how-to-use-virtual-doms-h-helper-in-head-for-header-dropdown-hamburger-widget-override-how-to-override-computed-method/104583/4 "2018-12-18T20:20:57Z")

</div>

@david

Another things that I’m trying to do, if you have an answer that will avoid the need to create a separate topic.

* * *

I want to throw a validation message when the user only chooses one level of category.

I was attempting to override `categoryValidation()` of composer.js.es6 … except that is a @computed method.

Looking at [https://github.com/discourse/discourse-assign/blob/master/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6#L69](https://github.com/discourse/discourse-assign/blob/master/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js.es6#L69) this should be doable.

**My issue is that from the `<head>`, I don’t have acces to `@computed`. Is there a way to require it?**

I did manage to override the `controller:composer` save action. However, from there I don’t have access to `InputValidation` to throw a custom error (I wouldn’t know how to target the correct input from there either).

```plaintext
<script type="text/discourse-plugin" version="0.8.23">
    api.modifyClass('controller:composer', {
        @computed("model.categoryId", "lastValidatedAt") //ReferenceError: computed is not defined
        categoryValidation() {
            console.log('categoryValidation');
            this._super();
        }
    });
</script> 

```

---

_[View the full topic](https://meta.discourse.org/t/solved-how-to-use-virtual-doms-h-helper-in-head-for-header-dropdown-hamburger-widget-override-how-to-override-computed-method/104583)._
